您的位置:首页 > 其它

WebChart 部分属性说明

2009-03-11 17:13 302 查看
曲线图:

   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();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c