public ActionResult OrganizationOverview() { List <Organization> orgs = (List <Organization>)im.GetOrganizations(); ViewBag.Organizations = orgs; Dictionary <string, Chart> charts = chartManager.GetStandardChart(); Dictionary <string, Chart> defCharts = new Dictionary <string, Chart>(); foreach (var chart in charts) { if (chart.Value.ItemType == "Organization") { chartManager.RetrieveDataChart(chart.Value); defCharts.Add(chart.Key, chart.Value); } } ViewBag.Charts = defCharts; return(View()); }
public ActionResult Index() { HomeViewModel viewModel = new HomeViewModel { Charts = chartManager.GetStandardChart() }; foreach (var chart in viewModel.Charts) { chartManager.RetrieveDataChart(chart.Value); } return(View(viewModel)); }
public IHttpActionResult GetHomeCharts() { List <SimpleChart> charts = new List <SimpleChart>(); foreach (KeyValuePair <string, Chart> entry in ChartManager.GetStandardChart()) { SimpleChart sc = new SimpleChart { Name = entry.Key, Type = entry.Value.ChartType, Data = entry.Value.ChartItemData }; charts.Add(sc); } return(Ok(charts)); }