//Use this constructor when the chart display is not user-configurable public GoogleChartJson(string legendTitle, string chartContainerID, GoogleChartConfiguration googleChartConfiguration, GoogleChartType googleChartType, GoogleChartDataTable googleChartDataTable, List <string> chartColumns) : this(legendTitle, chartContainerID, googleChartConfiguration, googleChartType, googleChartDataTable, chartColumns, null, null) { }
public void SetSeriesIgnoringNullGoogleChartSeries(GoogleChartDataTable googleChartDataTable) { var dictionary = new Dictionary <string, GoogleChartSeries>(); var googleChartSeries = googleChartDataTable.GoogleChartColumns.Where(x => x.GoogleChartSeries != null).Select(x => x.GoogleChartSeries).ToList(); for (var i = 0; i < googleChartSeries.Count; i++) { dictionary.Add(i.ToString(), googleChartSeries[i]); } Series = dictionary; }
public GooglePieChartConfiguration(string chartTitle, MeasurementUnitTypeEnum measurementUnitTypeEnum, List <GooglePieChartSlice> googlePieChartSlices, GoogleChartType googleChartType, GoogleChartDataTable googleChartDataTable) : base(chartTitle, true, googleChartType, googleChartDataTable, new GoogleChartAxis("Year", null, null), new List <GoogleChartAxis> { new GoogleChartAxis(null, measurementUnitTypeEnum, null) }) { PieSliceTextStyle = new GoogleChartTextStyle("black"); ChartArea = new GoogleChartConfigurationArea(10, 10); Slices = googlePieChartSlices; }
//Used where chartConfiguration comes as a GoogleChartConfiguration object //Use this constructor when the chart is not configurable - currently only PM charts public GoogleChartJson(string legendTitle, string chartContainerID, GoogleChartConfiguration googleChartConfiguration, GoogleChartType googleChartType, GoogleChartDataTable googleChartDataTable, List <string> chartColumns, string optionalSaveConfigurationUrl, string optionalResetConfigurationUrl) { LegendTitle = legendTitle; ChartContainerID = chartContainerID; GoogleChartConfiguration = googleChartConfiguration; ChartColumns = chartColumns; ChartType = googleChartType.GoogleChartTypeDisplayName; GoogleChartDataTable = googleChartDataTable; SaveConfigurationUrl = optionalSaveConfigurationUrl; OptionalResetConfigurationUrl = optionalResetConfigurationUrl; }
/// <summary> /// This is the constructor used by non-database-persisted charts <see cref="MonitoringStation.AverageDailyFlowAndCumulativePrecipitationSummaryGoogleChart()"/> /// </summary> public GoogleChartConfiguration(string chartTitle, bool isStacked, GoogleChartType googleChartType, GoogleChartDataTable googleChartDataTable, GoogleChartAxis googleChartAxisHorizontal, List <GoogleChartAxis> googleChartAxisVerticals) { Title = string.IsNullOrWhiteSpace(chartTitle) ? "[MISSING CHART TITLE]" : chartTitle; Legend = new GoogleChartLegend(); HorizontalAxis = googleChartAxisHorizontal; VerticalAxes = googleChartAxisVerticals; BackgroundColor = new GoogleChartBackground("white"); IsStacked = isStacked; LineWidth = 2; SetChartMetaData(googleChartType); var dictionary = new Dictionary <string, GoogleChartSeries>(); var googleChartSeries = googleChartDataTable.GoogleChartColumns.Select(x => x.GoogleChartSeries).ToList(); for (var i = 0; i < googleChartSeries.Count; i++) { dictionary.Add(i.ToString(), googleChartSeries[i]); } Series = dictionary; Annotations = new GoogleChartAnnotations(); }
/// <summary> /// This is the constuctor used by non-database-persisted charts <see cref="MonitoringStation.AverageDailyFlowAndCumulativePrecipitationSummaryGoogleChart()"/> /// </summary> public GoogleChartConfiguration(string chartTitle, bool isStacked, GoogleChartType googleChartType, GoogleChartDataTable googleChartDataTable, GoogleChartAxis googleChartAxisHorizontal, List <GoogleChartAxis> googleChartAxisVerticals) { Title = string.IsNullOrWhiteSpace(chartTitle) ? "[MISSING CHART TITLE]" : chartTitle; Legend = new GoogleChartLegend(); HorizontalAxis = googleChartAxisHorizontal; VerticalAxes = googleChartAxisVerticals; BackgroundColor = new GoogleChartBackground("white"); IsStacked = isStacked; LineWidth = 2; SetChartMetaData(googleChartType); Series = googleChartDataTable.GoogleChartColumns.Select(x => x.GoogleChartSeries).ToList(); Annotations = new GoogleChartAnnotations(); }