• MsChart<3> 饼状图


     

    MsChart,饼状图

    复制代码
     1 <asp:Chart ID="Chart1" runat="server" BorderlineDashStyle="Solid" BorderlineColor="Gray" Width="768px" BackGradientStyle="DiagonalLeft" BackSecondaryColor="AliceBlue"
    2 BackColor="WhiteSmoke">
    3 <Legends>
    4 <asp:Legend Name="Legend1" Alignment="Near">
    5 </asp:Legend>
    6 </Legends>
    7 <Series>
    8 <asp:Series Name="Series1" ChartType="Pie" Font="Arial">
    9 </asp:Series>
    10 </Series>
    11 <ChartAreas>
    12 <asp:ChartArea Name="ChartArea1">
    13 </asp:ChartArea>
    14 </ChartAreas>
    15 </asp:Chart>
    复制代码

    后台代码:(dt为数据源)数据库中数据Sample

    复制代码
    1 Chart1.Series["Series1"].Label = "#PERCENT{P}";//百分比形式
    2 Chart1.Series["Series1"].Points.DataBind(dt.DefaultView, "Result", "Score", "LegendText=Result,YValues=Score,ToolTip=Score");
    3 Chart1.Series["Series1"].ChartType = SeriesChartType.Pie;
    4 Chart1.Series["Series1"].ToolTip = "#LEGENDTEXT:#VAL{C} MILLION";
    5
    6 Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
    7 Chart1.DataBind();
    复制代码



    Chart Image的保存,下载:

    string path = @"C:ChartChart_" + DateTime.Now.ToString("yyyyMMddhhmm") + @"";

    if (!System.IO.Directory.Exists(path))
    {
          System.IO.Directory.CreateDirectory(path);
    }

    Chart1.SaveImage(path + "QC_Status.jpg", System.Web.UI.DataVisualization.Charting.ChartImageFormat.Jpeg);

    来源:http://www.cnblogs.com/eva_2010/archive/2011/12/12/2284919.html

  • 相关阅读:
    算法_二叉查找树
    Java编程思想学习笔记_2(继承和多态)
    算法_符号表
    算法_优先队列
    算法_快速排序
    Java编程思想学习笔记_1(Java内存和垃圾回收)
    map 与 lambda 的用法
    优化版九九乘法表
    low版九九乘法表
    python3爬虫lxml模块的安装
  • 原文地址:https://www.cnblogs.com/captain_ccc/p/4182007.html
Copyright © 2020-2023  润新知