首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C# 中 MSchart的使用,该怎么解决

2012-09-11 
C# 中 MSchart的使用在一个winform 程序中在 Form的 load 函数中添加如下代码:Chart c new Chart()c.Ch

C# 中 MSchart的使用

在一个winform 程序中 在 Form的 load 函数中添加如下代码:


Chart c = new Chart();
c.ChartAreas.Add(new ChartArea());
c.Width = 200;
c.Height = 200;
Series mySeries = new Series();
mySeries.Points.DataBindXY(new string[] { "one", "two", "three" }, new int[] { 1, 2, 3 });
//mySeries.LabelAngle = 45; // why doesn't this work?
c.Series.Add(mySeries);

为什么在form中不显示chart呢????

[解决办法]
想复杂了

C# code
using System.Windows.Forms.DataVisualization.Charting;... ...Chart c = new Chart();ChartArea Area1 = new ChartArea();Area1.BackColor = Color.Black;c.ChartAreas.Add(Area1);c.Width = 200;c.Height = 200;Series mySeries = new Series();mySeries.Points.DataBindXY(new string[] { "one", "two", "three" }, new int[] { 1, 2, 3 });// mySeries.LabelAngle = 45; // why doesn't this work?c.Series.Add(mySeries);[B][color=FF0033]this.controls.add(c);[color][/B] 

热点排行