chart 学习过程笔记02

来源:互联网 发布:djando绑定多个数据库 编辑:程序博客网 时间:2024/06/02 04:57
 

1、Chart1.Palette = ChartColorPalette.Berry;   是一个调色板,ChartColorPalette是一个类型,Berry是一个属性值,还有其它的属性值。
2、标签的添加   Chart1.Series[0].Label = "Y = #VALY\nX = #VALX";  
3、修改批注的大小:在设计时使用 Annotation.Width 和 Annotation.Height。

     在运行时使用 Annotation.Right 和 Annotation.Bottom
4、今天在官网上看到很多,说的很详细。http://msdn.microsoft.com/zh-cn/library/dd456727.aspx
5、还可以求出平均数 ----标签

  LegendCellColumn l = new LegendCellColumn();
             l.HeaderText = "姓名";
             l.Text = "#LEGENDTEXT";
             l.ColumnType = LegendCellColumnType.Text;
             Chart1.Legends[0].CellColumns.Add(l);
             l = new LegendCellColumn();
             l.HeaderText = "图例";
             l.ColumnType = LegendCellColumnType.SeriesSymbol;
             Chart1.Legends[0].CellColumns.Add(l);
             l = new LegendCellColumn();
             l.HeaderText = "平均数";
             l.ColumnType = LegendCellColumnType.Text;
             l.Text = "#AVG{n1}";
             Chart1.Legends[0].CellColumns.Add(l);

  "#AVG"和"#LEGENDTEXT"是关键字,区 分大小写,其它关键字:http://msdn.microsoft.com/zh-cn/library/dd456687.aspx

6、定义Y轴的最大值、最小值、比例尺和轴的类型
   Chart1.ChartAreas[0].AxisY.Minimum = 0;  最小值
             Chart1.ChartAreas[0].AxisY.Maximum = 10000;  最大值
             Chart1.ChartAreas[0].AxisY.Interval = 500;   比例尺
             Chart1.ChartAreas[0].AxisY.IntervalType =      (System.Web.UI.DataVisualization.Charting.DateTimeIntervalType)IntervalType.Number;  轴的类型

7、chart控件数据转换成dataset:DataSet dataset = Chart1.DataManipulator.ExportSeriesValues();
   然后给数据表控件绑定

 

写的有点乱,不过这都是在学习过程当中看不懂,一点点看的源代码找出来的。我这个不是学习文档,是一个学习过程当中给予提示的作用,或者引导的作用,减少查找属性的时间

原创粉丝点击