Esempio n. 1
0
        /// <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();
        }
Esempio n. 2
0
        /// <summary>
        /// This is the constructor used by <see cref="PerformanceMeasureModelExtensions.GetDefaultPerformanceMeasureChartConfigurationJson()"/> for creating a default google chart configuration json for new performance measures
        /// </summary>
        public GoogleChartConfiguration(string chartTitle, bool isStacked, GoogleChartType googleChartType, 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);

            Annotations = new GoogleChartAnnotations();
        }