zoukankan      html  css  js  c++  java
  • 图表:WebChartControl

    #region 画统计图
            /// <summary>
            /// 画统计图
            /// </summary>
            private void LoadWebChartControl()
            {
                this.WebChartControl1.Series.Clear();
                var sql = string.Format("{0} and ({1}) order by TimeTypeValue asc", GetSql_Chart(), string.IsNullOrEmpty(AspxGridViewPagger1.FilterSql) ? "1=1" : AspxGridViewPagger1.FilterSql);
                var data = Support.DBHelper.GetDataBySql(sql).ExecuteTable();
                WebChartControl1.Visible = data.Rows.Count >0;
                WebChartControl_Div.Visible = data.Rows.Count > 0;
                List<OrderStatics> listOrderStatics = new List<OrderStatics>();
                List<string> listTime = new List<string>();
                for (int i = 0; i < data.Rows.Count; i++)
                {
                    listOrderStatics.Add(new OrderStatics()
                    {
                        ChartName = data.Rows[i]["StaticObjValue"].ToString(),
                        ChartX = data.Rows[i]["TimeTypeValue"].ToString(),
                        ChartY = Tool.StringUnit.ToDecimal(data.Rows[i]["moneY"])
                    });
                    listTime.Add(data.Rows[i]["TimeTypeValue"].ToString());
                }
                List<string> listStaticObjValue = new List<string>();
                listOrderStatics.ForEach(o =>
                {
                    if (!listStaticObjValue.Contains(o.ChartName))
                    {
                        listStaticObjValue.Add(o.ChartName);
                    }
                });
              
                foreach (var objValue in listStaticObjValue)
                {
                    #region MyRegion
                    var series_name = string.Empty;
                    switch (StaObj)
                    {
                        case "SellerID"://业务员
                            series_name = GetSellerName(objValue);
                            break;
                        case "ShopName"://店铺
                            series_name = GetShopCName(objValue);
                            break;
                        case "ShippingAgent"://货代
                            series_name = objValue;
                            break;
                    }
                    Series series = new Series(series_name, ViewType.Line);
                    List<OrderStatics> listOrderStaticsItem = listOrderStatics.Where(z => z.ChartName == objValue).OrderBy(o => o.ChartX).ToList();
                    foreach (var item in listOrderStaticsItem)
                    {
                        series.Points.Add(new SeriesPoint(item.ChartX, item.ChartY));
                    }
    
                    //设置标题
                  //  var title = new ChartTitle()
                  //  WebChartControl1.Titles.Clear();
                    //WebChartControl1.Titles.Add(title);
                    series.Label.PointOptions.ValueNumericOptions.Format = NumericFormat.Percent;//设置数值显示为百分比
                    //series.Label.PointOptions.PointView = PointView.ArgumentAndValues; //设置参数值
                    series.ArgumentScaleType = ScaleType.Auto;//设置x坐标显示类型(Qualitative:定性的)
                    WebChartControl1.BinaryStorageMode = BinaryStorageMode.Session;
                    this.WebChartControl1.Series.Add(series);
                    #endregion
                }
            }
          
            #endregion
      <dxchartsui:WebChartControl ID="WebChartControl1" runat="server" Width="1260" Height="300"
                                        ShowLoadingPanelImage="True">
                                    </dxchartsui:WebChartControl>

  • 相关阅读:
    BZOJ3098 Hash Killer II 【概率】
    BZOJ4010 [HNOI2015]菜肴制作 【拓扑排序 + 贪心】
    洛谷P4364 [九省联考2018]IIIDX 【线段树】
    洛谷P4363 [九省联考2018]一双木棋chess 【状压dp】
    洛谷P2664 树上游戏 【点分治 + 差分】
    BZOJ1189 [HNOI2007]紧急疏散evacuate 【二分 + 网络流】
    BZOJ1068 [SCOI2007]压缩 【区间dp】
    BZOJ4033 [HAOI2015]树上染色 【树形dp】
    BZOJ4819 [Sdoi2017]新生舞会 【01分数规划 + 费用流】
    排序
  • 原文地址:https://www.cnblogs.com/wzq806341010/p/3868644.html
Copyright © 2011-2022 走看看