百度空间 | 百度首页 
 
查看文章
 
WebChart 部分属性说明
2008-08-07 13:58

曲线图:

   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();


类别:asp.net | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu