public PartialViewResult Dashboard(string frmDate, string toDate) { string startDate = "2016-09-15"; string endDate = "2018-09-04"; if (frmDate != null) { startDate = frmDate; endDate = toDate; } //values for the date picker //ViewBag.startDate = new DateTime(2017, 05, 31); //ViewBag.endDate = new DateTime(2017, 11, 30); ViewBag.startDate = DateTime.Parse(startDate); ViewBag.endDate = DateTime.Parse(endDate); // values for boxes DataForBoxes boxes = GetBoxesData(startDate, endDate, connectionString); ViewBag.revenue = boxes.revenue; //TempData["revenue"] = boxes.revenue; ViewBag.shipping = boxes.shipping; ViewBag.netRev = boxes.net_rev; ViewBag.avgPrice = boxes.avg_price; //values for the pie chart //List<DataForPie> piechart = GetPieState(startDate, endDate, connectionString); //ViewBag.pieDataSource = JsonConvert.SerializeObject(pieChart); ViewBag.pieDataSource = GetPieState(startDate, endDate, connectionString); ViewBag.lineDS = GetAreaChartData(startDate, endDate, connectionString); ViewBag.barDS = GetBarChartData(startDate, endDate, connectionString); ViewBag.dsTable = GetTableData(startDate, endDate, connectionString); ViewBag.animation = new { enable = false }; ViewBag.palettes = new string[] { "#61EFCD", "#CDDE1F", "#FEC200", "#CA765A", "#2485FA", "#F57D7D", "#C152D2", "#8854D9", "#3D4EB8", "#00BCD7" }; ViewBag.legentSettings = new { visible = true }; ViewBag.chartarea = new ChartBorder { Width = 0 }; ViewBag.content = "<p style='font-family:Roboto;font-size: 16px;font-weight: 400;font-weight: 400;letter-spacing: 0.02em;line-height: 16px;color: #797979 !important;'>Account - Balance</p>"; ViewBag.border = new ChartBorder { Width = 0.5, Color = "#0470D8" }; ViewBag.margin = new ChartMargin { Top = 90 }; ViewBag.accBalancecontent = "<p style='font-family:Roboto;font-size: 16px;font-weight: 400;font-weight: 400;letter-spacing: 0.02em;line-height: 16px;color: #797979 !important;'>Income - Expense</p>"; ViewBag.accBalanceborder = new ChartBorder { Width = 0.5, Color = "#A16EE5" }; ViewBag.gridToolbar = new object[] { new { text = "Recent Transactions" } }; return(PartialView()); }
public ActionResult updateRange(string frmDate, string toDate) { // values for boxes DataForBoxes boxes = GetBoxesData(frmDate, toDate, connectionString); string revenue = String.Format("{0:0,0}", boxes.revenue); string shipping = String.Format("{0:0,0}", boxes.shipping); string netRev = String.Format("{0:0,0}", boxes.net_rev); string avgPrice = String.Format("{0:0,0}", boxes.avg_price); return(Json(new { rev = revenue , ship = shipping , net = netRev , avg = avgPrice , pieDataSource = GetPieState(frmDate, toDate, connectionString) , lineDS = GetAreaChartData(frmDate, toDate, connectionString) , barDS = GetBarChartData(frmDate, toDate, connectionString) , dsTable = GetTableData(frmDate, toDate, connectionString) })); }