圖表:WebChartControl

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   io   width   2014   

#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>

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.