public ExcelResult DownloadPerformanceMeasureChartData(DownloadChartDataViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                throw new Exception("Invalid POST data.");
            }

            var excelWorkbook = viewModel.GetExcelWorkbook(x => ExcelWorkbookSheetDescriptorFactory.MakeWorksheet(x.LegendTitle,
                                                                                                                  new PerformanceMeasureChartExcelSpec(x.GoogleChartDataTable.GoogleChartColumns.Where(y => PerformanceMeasureChartDataSimple.IsValidColumn(y.ColumnLabel, x)).ToList()),
                                                                                                                  PerformanceMeasureChartDataSimple.DeriveSimplesFromGoogleChartJson(x, viewModel.MainColumnLabel)) as IExcelWorkbookSheetDescriptor);

            return(new ExcelResult(excelWorkbook, viewModel.ExcelFilename));
        }
        public ExcelResult DownloadChartData(DownloadChartDataViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                throw new Exception("Invalid POST data.");
            }

            var excelWorkbook = viewModel.GetExcelWorkbook(x => ExcelWorkbookSheetDescriptorFactory.MakeWorksheet(x.GoogleChartConfiguration.Title,
                                                                                                                  new GoogleChartExcelSpec(x.GoogleChartDataTable.GoogleChartColumns),
                                                                                                                  GoogleChartDataSimple.DeriveSimplesFromGoogleChartJson(x)) as IExcelWorkbookSheetDescriptor);

            return(new ExcelResult(excelWorkbook, viewModel.ExcelFilename));
        }