public virtual ActionResult Get(EdFiDashboardContext context, string title)
        {
            var metricVariantId = context.MetricVariantId.GetValueOrDefault();

            var historicalLearningObjChart = historicalLearningObjectiveService.Get(new HistoricalLearningObjectivesChartRequest()
                                                                                {
                                                                                    StudentUSI = context.StudentUSI.GetValueOrDefault(),
                                                                                    SchoolId = context.SchoolId.GetValueOrDefault(),
                                                                                    MetricVariantId = metricVariantId,
                                                                                    Title = title
                                                                                });

            var chartViewModel = new ChartViewModel
                                     {
                                         ChartData = historicalLearningObjChart,
                                         Width =  740,
                                         Height = 250,
                                         EachSeriesInNewChartArea = false,
                                         ChartType = SeriesChartType.Column,
                                         DisplayLegend = false,
                                         YMin = GetChartDisplayAxisYMin(metricVariantId),
                                         YMax = GetChartDisplayAxisYMax(metricVariantId),
                                         AxisYInterval = GetChartDisplayAxisYInterval(metricVariantId),
                                         AxisYLabelFormat = GetChartDisplayAxisYLabelFormat(metricVariantId),
                                         AxisYCustomLabels = GetChartDisplayAxisYCustomLabels(metricVariantId)
                                     };

            return View(chartViewModel);
        }
示例#2
0
 public static IHtmlString BarChart(this HtmlHelper html, ChartViewModel viewModel)
 {
     return html.BarChart(viewModel.ChartData, viewModel.Width, viewModel.Height, viewModel.YMax, viewModel.YMin, 
         viewModel.AxisYInterval, viewModel.AxisYLabelFormat, viewModel.DisplayLegend,
         viewModel.ChartType, viewModel.EachSeriesInNewChartArea, viewModel.AxisYCustomLabels);
 }