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 万";

  • 相关阅读:
    watch 一些实际用法(vue)
    如何动态渲染多个echart图表小结(vue)
    webstorm 合并代码冲突后如何唤起代码合并弹窗方案
    jQuery Mobile
    响应式布局
    Angularjs
    项目经理PPT演讲意见
    创业者自己摸索总结的12条建议
    关于网站建设
    调研方案如何炼成?
  • 原文地址:https://www.cnblogs.com/lmy213/p/2599072.html
Copyright © 2011-2022 走看看