您的位置:首页 > 其它

WebChart 部分属性说明

2007-09-27 17:02 351 查看
最近弄了两天WebChart,感觉功能还不错,弄清了部分功能,先记下来,以后再慢慢完善,希望各位同行熟悉的都帮忙完善一下,大家共同整理出一个比较好的WebChart的属性说明:

曲线图:

ChartPointCollection d = new ChartPointCollection();

Chart c = new LineChart(d,Color.Blue);

柱状图:

Chart c = new StackedColumnChart();

ChartPointCollection d;

d = c.Data;

饼状图:

ChartPointCollection data = new ChartPointCollection();

PieChart c = new PieChart(data, Color.Blue);

c.Colors = new Color[] { Color.Red, Color.Blue, Color.Yellow, Color.Cyan, Color.AntiqueWhite, Color.RosyBrown };

添加数据:

data.Add(new ChartPoint("Ene", 40));

data.Add(new ChartPoint("Feb", 40));

data.Add(new ChartPoint("Mar", 30));

data.Add(new ChartPoint("Abr", 20));

data.Add(new ChartPoint("May", 10));

data.Add(new ChartPoint("Jun", 25));

属性说明:

////绘制箭头

AdjustableArrowCap MyArrow = new AdjustableArrowCap(4, 4, true);

c.Line.CustomEndCap = MyArrow;

c.Line.EndCap = LineCap.Custom;

////线段颜色

c.Line.Color = Color.Red;

///

c.ShowLineMarkers = true;

c.LineMarker = new CircleLineMarker(2, c.Fill.Color, Color.Black);

/////显示文字

c.DataLabels.Visible = true;

c.DataLabels.NumberFormat = "C";

c.DataLabels.ForeColor = Color.Black;

c.Fill.Color = Color.Black;

////显示边侧说明

c.Legend = "浏览次数";

WebChart1.HasChartLegend = true;

///将设置好的图像添加至图表

WebChart1.Charts.Add(c);

WebChart1.RedrawChart();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: