Пример #1
0
        //Used where chartConfiguration comes as a GoogleChartConfiguration object
        public GoogleChartJson(string legendTitle,
                               string chartContainerID,
                               GoogleChartConfiguration googleChartConfiguration,
                               GoogleChartType googleChartType,
                               GoogleChartDataTable googleChartDataTable,
                               string optionalSaveConfigurationUrl,
                               List <string> chartColumns)
        {
            LegendTitle              = legendTitle;
            ChartContainerID         = chartContainerID;
            GoogleChartConfiguration = googleChartConfiguration;
            ChartColumns             = chartColumns;

            ChartType            = googleChartType.GoogleChartTypeDisplayName;
            GoogleChartDataTable = googleChartDataTable;
            SaveConfigurationUrl = optionalSaveConfigurationUrl;
        }
Пример #2
0
 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;
 }
Пример #3
0
        /// <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();
        }