在运行时更改3d属性 [英] changing 3d properties at runtime
问题描述
使用图表对象,我想在运行时更改其行为.这样做: nbsp; b&b ; nbsp; b ; nbsp; b ; Public _ChartArea as ChartArea3DStyle 然后 &bsp; b nbsp; bsp nbsp; bsp nbsp; bsp _ChartArea =新ChartArea3DStyle() &nspsp nbsp; bsp nbsp; bsp nbsp; bsp _ChartArea.Enable3D = True,不会更改任何内容. nbsp; bsp nbsp; bsp nbsp; bsp 感谢您的帮助,Enzo
Using chart object i want to change its behaviour at runtime. Doing this: Public _ChartArea As ChartArea3DStyle and then _ChartArea = New ChartArea3DStyle() _ChartArea.Enable3D = True, does not change anything. Thanks for help, Enzo
推荐答案
请使用插入代码块"(Insert Code Block)当您在帖子中插入代码时,可以使用编辑器顶部的按钮,以便我们阅读.
Please use the "Insert Code Block" button at the top of the editor when you insert code into your posts so that we can read it.
无论如何,您并未真正为我们提供足够的背景信息来了解何时何地进行此操作.我看不到要在何处设置ChartArea3DStyle的任何值来设置3DStyle的外观.这是我设置3DStyle的简单示例 到ChartArea以及如何打开/关闭3DStyle.也许它将帮助您了解代码中需要执行的操作.
Anyways, you have not really given us enough context into when and where this is being done. I do not see where you are setting any values of the ChartArea3DStyle to set the look of the 3DStyle. Here is a simple example of how i set a 3DStyle to the ChartArea and how i can turn the 3DStyle On/Off. Perhaps it will help you understand what you need to do in your code.
虽然我没有包含用于设置图表和添加数据点的代码.那真的不重要.
I did not include the code i used for setting up my chart and add data points though. That really is not of importance.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'This adds a new ChartArea3DStyle for ChartArea(0) and sets the Rotation property
Dim style As New DataVisualization.Charting.ChartArea3DStyle(Chart1.ChartAreas(0))
style.Enable3D = True
style.Rotation = 33
Chart1.ChartAreas(0).Area3DStyle = style
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
'This just toggles the Enable3D property True/False
Chart1.ChartAreas(0).Area3DStyle.Enable3D = Not Chart1.ChartAreas(0).Area3DStyle.Enable3D
End Sub
这就是它的作用...
Here is what it does...
这篇关于在运行时更改3d属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!