Echarts折れ線図の例

2821 ワード

会社は累積収益図を作るように要求しています.Echartsを使ったことがないので、ここに記録してください.
htmlページ




    
    ECharts
    
    
    




Controller控制器

        /// 
        ///        
        ///    2018 12 5 
        ///        
        /// 
        ///     
        ///     
        /// region 0-  ,1-     ,3-     
        /// 
        [HttpPost]
        public JsonResult GetCumulativeIncomeTrend(int region,string code)
        {
             ResultObjOfEchartsDatajao5I8VC ro = null;
            {
                ServiceClientHelper.Invoke(new BFT0Strategy_ContractClient(), client =>
                {
                    ro = client.BFGetCumulativeIncomeTrend(SessionHelper.Token, region,code);
                });
            }
            return Json(ro, JsonRequestBehavior.DenyGet);

        }
アプリサービス
        /// 
        ///        
        ///    2018 12 6 
        ///           
        /// 
        /// 0-
        /// 
        /// 
        /// 
        public ResultObj BFGetCumulativeIncomeTrend(string validateGuid,int region, string code)
        {
            var ro = new ResultObj();
            var bll = new t_bf_t0strategy_BLL();
            try
            {
                if (!string.IsNullOrWhiteSpace(code))
                {
                    var data = bll.GetCumulativeIncomeTrend(region,code);
                    ro.code = (int)EHttpStatus.OK;
                    ro.msg = "    !";
                    ro.data = data;
                }
                else
                {
                    ro.code = (int)EHttpStatus.ParameterError;
                    ro.msg = "    !";
                }
            }
            catch (Exception ex)
            {
                ro.code = (int)EHttpStatus.ParameterError;
                ro.msg = "       !";
                LogHelper.WriteLog("BFGetCumulativeIncomeTrend()->\r
\t【Message】:" + ex.Message + "\r
\t【StackTrace】:" + ex.StackTrace + "\r
\t【Parameters】:" ); } return ro; }
転載先:https://www.cnblogs.com/tanfuchao/p/10081812.html