.net图表控制是否可以编辑 [英] can .net chart conrols be editable

查看:75
本文介绍了.net图表控制是否可以编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



是否可以在运行时编辑图形?
我正在使用.net图表控件显示折线图.我还想在运行时向图中添加点并将其保存到sql server数据库中.有没有办法做到这一点?

是的,您可以在运行时将点添加到MS Chart控件.使用类似下面的代码.

  public 图表myChart;

// 初始化图表.... 

// 新数据
 double  newX =  20 . 0 ;
 double  newY =  10 . 25 ;

 int  currentSeries =  0 ; // 设置为要添加点的序列
myChart.Series [currentSeries] .Points.AddXY(newX,newY); 


是否有一个属性可以使用.net图表控件进行放大和缩小.只有Windows Forms控件可以启用缩放和滚动,而ASP.NET图表控件不支持缩放和滚动.
但是我正在使用webforms(System.Web.UI.DataVisualization.Charting).是否可以?如果需要代码plz.


回答解决方案2中的问题. MS图表控件允许对WinForms进行缩放和滚动,但对于ASP.NET则不允许进行缩放. 查看本文 [这些链接 [ ^ ]用于MS图表控件. DL特别适合您,并尝试在此处找到的ASP.NET示例 [ ^ ].

Hi ,

Is it possible to edit graph on runtime?
I am using .net chart controls for displaying a line graph.I would also like to add points to the graph during runtime and save to the sql server database.is there a way to do this ?

thanks

解决方案

Yes, you can add points to a MS Chart control at runtime. Use something like the following code.

public Chart myChart;

//initialize chart ....

//new data
double newX = 20.0;
double newY = 10.25;

int currentSeries = 0;//set to the series to which you want to add points
myChart.Series[currentSeries].Points.AddXY(newX , newY);


Is there a property to zoomin and zoomout using .net chart controls.I read some articles stating only Windows Forms control you can enable zooming and scrolling whereas ASP.NET chart control doesnt support zooming and scrolling.
But I am using webforms(System.Web.UI.DataVisualization.Charting).So is it possible?if so i need the code plz.


In answer to the question in Solution 2. The MS Chart Controls allow zooming and scrolling for WinForms, but not for ASP.NET; see this article[^].
Also, to learn more about MS Charts take a look at these links[^] for MS Chart Controls. You especially should DL and try out the ASP.NET samples found here[^].


这篇关于.net图表控制是否可以编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆