zoukankan      html  css  js  c++  java
  • asp.net Chart 饼状图

        DataSet ds = DbHelperOleDb.Query(sbSql.ToString());
                DataTable dt = ds.Tables[0];
                string[] agencyname = new string[6];
                double[] sumshares = new double[6];
                sumshares[5] = 0;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (i < 5)
                    {
                        agencyname[i] = dt.Rows[i]["fund_Name"].ToString();
                        sumshares[i] = double.Parse(dt.Rows[i]["total_share"].ToString());
                    }
                    else
                    {
                        agencyname[5] = "其他";
                        sumshares[5] += double.Parse(dt.Rows[i]["total_share"].ToString());
                    }
                }
                sumshares[5] = Math.Ceiling(sumshares[5]);
                Chart1.Series["Series1"].Points.DataBindXY(agencyname, sumshares);
                Chart1.Series["Series1"].ChartType = SeriesChartType.Pie;
                //参数是否在图类显示(Inside内,Outside 外)
                Chart1.Series["Series1"]["PieLabelStyle"] = "Inside";
                Chart1.Series["Series1"].LegendText = "#VALX #VAL 万";

  • 相关阅读:
    Centos系统python2.x升级python3.x
    VirtualBox安装Ghost XP
    VirtualBox检查更新失败解决办法
    PyDev+eclipse的编码问题
    redhat开启linux server
    使用VNC实现多用户登录linux系统
    使用webdav实现文档共享
    各类软件使用说明
    linux安装apache软件的过程
    JavaScript获取DOM元素位置和尺寸大小
  • 原文地址:https://www.cnblogs.com/lmy213/p/2599072.html
Copyright © 2011-2022 走看看