public static BarChartViewModel BarPoints(List <AxisPoint> AxList) { BarChartViewModel list = new BarChartViewModel(); int days = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); string[] label = new string[days]; decimal[] Value = new decimal[days]; int j = 0; for (int i = 1; i <= days; i++) { label[j] = i.ToString(); var data = AxList.Where(x => x.X == i).FirstOrDefault(); if (data != null) { Value[j] = data.Y; } else { Value[j] = 0; } j++; } list.BarChartLbl = label; list.DataY = Value; return(list); }
public RevenueReportViewModel() { BarChartData = new BarChartViewModel(); BarChartData.BarChartLbl = new string[] { "June", "July", "August", "Setember", "October", "November", "December" }; //BarChartData.DataX = new int[] { 55, 40, 80, 81, 56, 55, 40 }; //BarChartData.DataY = new int[] { 27, 90, 40, 19, 86, 27, 90 }; DonutChartData = new int[] { 30, 20, 12 }; //LineChartData = new List<LineChartViewModel> //{ // new LineChartViewModel{ y="2011 Q1" , item1 = 2666}, // new LineChartViewModel{ y="2011 Q2" , item1 = 2778}, // new LineChartViewModel{ y="2011 Q3" , item1 = 4912}, // new LineChartViewModel{ y="2011 Q4" , item1 = 3767}, // new LineChartViewModel{ y="2012 Q1" , item1 = 6810}, // new LineChartViewModel{ y="2012 Q2" , item1 = 5670}, // new LineChartViewModel{ y="2012 Q3" , item1 = 4820}, // new LineChartViewModel{ y="2012 Q4" , item1 = 15073}, // new LineChartViewModel{ y="2013 Q1" , item1 = 10687}, // new LineChartViewModel{ y="2013 Q2" , item1 = 8432}, //}; }