Exemplo n.º 1
0
        /// <summary>
        /// 插入图表
        /// </summary>
        static void InsertChart()
        {
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Add chart with default data. You can specify different chart types and sizes.
            Shape shape = builder.InsertChart(ChartType.Line, 432, 252);

            // Chart property of Shape contains all chart related options.
            Chart chart = shape.Chart;

            // Get chart series collection.
            ChartSeriesCollection seriesColl = chart.Series;

            // Delete default generated series.
            seriesColl.Clear();

            // Create category names array, in this example we have two categories.
            string[] categories = new string[] { "AW Category 1", "AW Category 1" };

            // Adding new series. Please note, data arrays must not be empty and arrays must be the same size.
            seriesColl.Add("AW Series 1", categories, new double[] { 1, 2 });
            seriesColl.Add("AW Series 2", categories, new double[] { 3, 4 });
            seriesColl.Add("AW Series 3", categories, new double[] { 5, 6 });
            seriesColl.Add("AW Series 4", categories, new double[] { 7, 8 });
            seriesColl.Add("AW Series 5", categories, new double[] { 9, 10 });

            doc.Save(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestInsertChartColumn.docx"));
        }
Exemplo n.º 2
0
        public void DataArraysWrongSize()
        {
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Add chart with default data.
            Shape shape = builder.InsertChart(ChartType.Line, 432, 252);
            Chart chart = shape.Chart;

            ChartSeriesCollection seriesColl = chart.Series;

            seriesColl.Clear();

            // Create category names array, second category will be null.
            string[] categories = { "Cat1", null, "Cat3", "Cat4", "Cat5", null };

            // Adding new series with empty (double.NaN) values.
            seriesColl.Add("AW Series 1", categories, new double[] { 1, 2, double.NaN, 4, 5, 6 });
            seriesColl.Add("AW Series 2", categories, new double[] { 2, 3, double.NaN, 5, 6, 7 });

            Assert.That(
                () => seriesColl.Add("AW Series 3", categories, new[] { double.NaN, 4, 5, double.NaN, double.NaN }),
                Throws.TypeOf <ArgumentException>());
            Assert.That(
                () => seriesColl.Add("AW Series 4", categories,
                                     new[] { double.NaN, double.NaN, double.NaN, double.NaN, double.NaN }),
                Throws.TypeOf <ArgumentException>());
        }
Exemplo n.º 3
0
        public void EmptyValuesInChartData()
        {
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Add chart with default data.
            Shape shape = builder.InsertChart(ChartType.Line, 432, 252);
            Chart chart = shape.Chart;

            ChartSeriesCollection seriesColl = chart.Series;

            seriesColl.Clear();

            // Create category names array, second category will be null.
            string[] categories = { "Cat1", null, "Cat3", "Cat4", "Cat5", null };

            // Adding new series with empty (double.NaN) values.
            seriesColl.Add("AW Series 1", categories, new[] { 1, 2, double.NaN, 4, 5, 6 });
            seriesColl.Add("AW Series 2", categories, new[] { 2, 3, double.NaN, 5, 6, 7 });
            seriesColl.Add("AW Series 3", categories, new[] { double.NaN, 4, 5, double.NaN, 7, 8 });
            seriesColl.Add("AW Series 4", categories,
                           new[] { double.NaN, double.NaN, double.NaN, double.NaN, double.NaN, 9 });

            doc.Save(ArtifactsDir + "Charts.EmptyValuesInChartData.docx");
        }
Exemplo n.º 4
0
        public ViewModel()
        {
            Data   = new ObservableCollection <Model>();
            Series = new ChartSeriesCollection();

            var random = new Random();

            for (var i = 0; i < 200; i++)
            {
                Data.Add(new Model {
                    XValue = Date, YValue = random.Next(1, 69)
                });
                Date = Date.AddMinutes(13);
            }

            foreach (var batch in Data.Batch(100))
            {
                Series.Add(new FastLineSeries
                {
                    ItemsSource  = batch,
                    XBindingPath = "XValue",
                    YBindingPath = "YValue",
                    Color        = GetRandomColor()
                });
            }
        }
        public void InsertSimpleColumnChart()
        {
            //ExStart:InsertSimpleColumnChart
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // You can specify different chart types and sizes.
            Shape shape = builder.InsertChart(ChartType.Column, 432, 252);

            Chart chart = shape.Chart;
            //ExStart:ChartSeriesCollection
            ChartSeriesCollection seriesColl = chart.Series;

            Console.WriteLine(seriesColl.Count);
            //ExEnd:ChartSeriesCollection

            // Delete default generated series.
            seriesColl.Clear();

            // Create category names array, in this example we have two categories.
            string[] categories = new string[] { "Category 1", "Category 2" };

            // Please note, data arrays must not be empty and arrays must be the same size.
            seriesColl.Add("Aspose Series 1", categories, new double[] { 1, 2 });
            seriesColl.Add("Aspose Series 2", categories, new double[] { 3, 4 });
            seriesColl.Add("Aspose Series 3", categories, new double[] { 5, 6 });
            seriesColl.Add("Aspose Series 4", categories, new double[] { 7, 8 });
            seriesColl.Add("Aspose Series 5", categories, new double[] { 9, 10 });

            doc.Save(ArtifactsDir + "WorkingWithCharts.InsertSimpleColumnChart.docx");
            //ExEnd:InsertSimpleColumnChart
        }
Exemplo n.º 6
0
        public void AddSummaries(ChartSeriesCollection series)
        {
            GroupInfo leafGroupInfo = this.GetLeafGroupInfo();

            GroupSummaryCollection summaries = series.CreateSummaies(this._StatType);

            leafGroupInfo.Summaries = summaries.CopyStructure();
        }
Exemplo n.º 7
0
            public StarsTrendsChart(IMainThread mainThread) : base(mainThread, TrendsPageAutomationIds.StarsChart)
            {
                var primaryAxisLabelStyle = new ChartAxisLabelStyle
                {
                    FontSize   = 9,
                    FontFamily = FontFamilyConstants.RobotoRegular,
                    Margin     = new Thickness(2, 4, 2, 0)
                }.DynamicResource(ChartLabelStyle.TextColorProperty, nameof(BaseTheme.ChartAxisTextColor));

                var axisLineStyle = new ChartLineStyle()
                {
                    StrokeWidth = 1.51
                }.DynamicResource(ChartLineStyle.StrokeColorProperty, nameof(BaseTheme.ChartAxisLineColor));

                PrimaryAxis = new DateTimeAxis
                {
                    IntervalType   = DateTimeIntervalType.Months,
                    Interval       = 1,
                    RangePadding   = DateTimeRangePadding.Round,
                    LabelStyle     = primaryAxisLabelStyle,
                    AxisLineStyle  = axisLineStyle,
                    MajorTickStyle = new ChartAxisTickStyle {
                        StrokeColor = Color.Transparent
                    },
                    ShowMajorGridLines = false,
                };
                PrimaryAxis.SetBinding(DateTimeAxis.MinimumProperty, nameof(TrendsViewModel.MinDailyStarsDate));
                PrimaryAxis.SetBinding(DateTimeAxis.MaximumProperty, nameof(TrendsViewModel.MaxDailyStarsDate));

                var secondaryAxisMajorTickStyle = new ChartAxisTickStyle().DynamicResource(ChartAxisTickStyle.StrokeColorProperty, nameof(BaseTheme.ChartAxisLineColor));

                var secondaryAxisLabelStyle = new ChartAxisLabelStyle
                {
                    FontSize   = 12,
                    FontFamily = FontFamilyConstants.RobotoRegular,
                }.DynamicResource(ChartLabelStyle.TextColorProperty, nameof(BaseTheme.ChartAxisTextColor));

                SecondaryAxis = new NumericalAxis
                {
                    LabelStyle         = secondaryAxisLabelStyle,
                    AxisLineStyle      = axisLineStyle,
                    MajorTickStyle     = secondaryAxisMajorTickStyle,
                    ShowMajorGridLines = false,
                }.Bind(NumericalAxis.MinimumProperty, nameof(TrendsViewModel.MinDailyStarsValue))
                .Bind(NumericalAxis.MaximumProperty, nameof(TrendsViewModel.MaxDailyStarsValue))
                .Bind(NumericalAxis.IntervalProperty, nameof(TrendsViewModel.StarsChartYAxisInterval));

                StarsSeries = new TrendsAreaSeries(TrendsChartTitleConstants.StarsTitle, nameof(DailyStarsModel.LocalDay), nameof(DailyStarsModel.TotalStars), nameof(BaseTheme.CardStarsStatsIconColor));
                StarsSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyStarsList));
                StarsSeries.PropertyChanged += HandleStarSeriesPropertyChanged;

                Series = new ChartSeriesCollection {
                    StarsSeries
                };

                this.SetBinding(IsVisibleProperty, nameof(TrendsViewModel.IsStarsChartVisible));
            }
Exemplo n.º 8
0
        public void ChartSeriesCollectionModify()
        {
            //ExStart
            //ExFor:Charts.ChartSeriesCollection
            //ExFor:Charts.ChartSeriesCollection.Clear
            //ExFor:Charts.ChartSeriesCollection.Count
            //ExFor:Charts.ChartSeriesCollection.GetEnumerator
            //ExFor:Charts.ChartSeriesCollection.Item(Int32)
            //ExFor:Charts.ChartSeriesCollection.RemoveAt(Int32)
            //ExSummary:Shows how to work with a chart's data collection.
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Use a document builder to insert a bar chart
            Shape chartShape = builder.InsertChart(ChartType.Column, 400, 300);
            Chart chart      = chartShape.Chart;

            // All charts come with demo data
            // This column chart currently has 3 series with 4 categories, which means 4 clusters, 3 columns in each
            ChartSeriesCollection chartData = chart.Series;

            Assert.AreEqual(3, chartData.Count);

            // Iterate through the series with an enumerator and print their names
            using (IEnumerator <ChartSeries> enumerator = chart.Series.GetEnumerator())
            {
                // And use it to go over all the data labels in one series and change their separator
                while (enumerator.MoveNext())
                {
                    Console.WriteLine(enumerator.Current.Name);
                }
            }

            // We can add new data by adding a new series to the collection, with categories and data
            // We will match the existing category/series names in the demo data and add a 4th column to each column cluster
            string[] categories = { "Category 1", "Category 2", "Category 3", "Category 4" };
            chart.Series.Add("Series 4", categories, new[] { 4.4, 7.0, 3.5, 2.1 });

            Assert.AreEqual(4, chartData.Count);
            Assert.AreEqual("Series 4", chartData[3].Name);

            // We can remove series by index
            chartData.RemoveAt(2);

            Assert.AreEqual(3, chartData.Count);
            Assert.AreEqual("Series 4", chartData[2].Name);

            // We can also remove out all the series
            // This leaves us with an empty graph and is a convenient way of wiping out demo data
            chartData.Clear();

            Assert.AreEqual(0, chartData.Count);
            //ExEnd
        }
Exemplo n.º 9
0
        public AreaSeriesChart()
        {
            const int numberOfDays = 20;
            const int maxValue     = 100;

            var dataSource = GenerateData(numberOfDays, maxValue).ToList();

            var areaSeries = new AreaSeries
            {
                Opacity      = 0.9,
                Label        = nameof(ChartDataModel),
                ItemsSource  = dataSource,
                XBindingPath = nameof(ChartDataModel.Date),
                YBindingPath = nameof(ChartDataModel.Value)
            };

            Series = new ChartSeriesCollection {
                areaSeries
            };

            PrimaryAxis = new DateTimeAxis
            {
                IntervalType = DateTimeIntervalType.Days,
                Interval     = 1,
                RangePadding = DateTimeRangePadding.Round,
                Minimum      = dataSource.Min(x => x.Date),
                Maximum      = dataSource.Max(x => x.Date)
            };

            SecondaryAxis = new NumericalAxis
            {
                Minimum = 0,
                Maximum = maxValue
            };

            ChartBehaviors = new ChartBehaviorCollection
            {
                new ChartZoomPanBehavior(),
                new ChartTrackballBehavior()
            };
        }
        /// <summary>
        ///  Shows how to insert a simple column chart into the document using DocumentBuilder.InsertChart method.
        /// </summary>
        private static void InsertSimpleColumnChart(string dataDir)
        {
            // ExStart:InsertSimpleColumnChart
            Document        doc     = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Add chart with default data. You can specify different chart types and sizes.
            Shape shape = builder.InsertChart(ChartType.Column, 432, 252);

            // Chart property of Shape contains all chart related options.
            Chart chart = shape.Chart;

            // ExStart:ChartSeriesCollection
            // Get chart series collection.
            ChartSeriesCollection seriesColl = chart.Series;

            // Check series count.
            Console.WriteLine(seriesColl.Count);
            // ExEnd:ChartSeriesCollection

            // Delete default generated series.
            seriesColl.Clear();

            // Create category names array, in this example we have two categories.
            string[] categories = new string[] { "AW Category 1", "AW Category 2" };

            // Adding new series. Please note, data arrays must not be empty and arrays must be the same size.
            seriesColl.Add("AW Series 1", categories, new double[] { 1, 2 });
            seriesColl.Add("AW Series 2", categories, new double[] { 3, 4 });
            seriesColl.Add("AW Series 3", categories, new double[] { 5, 6 });
            seriesColl.Add("AW Series 4", categories, new double[] { 7, 8 });
            seriesColl.Add("AW Series 5", categories, new double[] { 9, 10 });

            dataDir = dataDir + @"TestInsertSimpleChartColumn_out.doc";
            doc.Save(dataDir);
            // ExEnd:InsertSimpleColumnChart
            Console.WriteLine("\nSimple column chart created successfully.\nFile saved at " + dataDir);
        }
Exemplo n.º 11
0
 public DnnChartSeries(ChartSeriesCollection parent) : base(parent)
 {
 }
Exemplo n.º 12
0
 public DnnChartSeries(string seriesName, ChartSeriesType chartSeriesType, ChartSeriesCollection parent, ChartYAxisType yAxisType, StyleSeries style, string dataYColumn, string dataXColumn,
                       string dataYColumn2, string dataXColumn2, string dataYColumn3, string dataYColumn4, string dataLabelsColumn)
     : base(seriesName, chartSeriesType, parent, yAxisType, style, dataYColumn, dataXColumn, dataYColumn2, dataXColumn2, dataYColumn3, dataYColumn4, dataLabelsColumn)
 {
 }
Exemplo n.º 13
0
 public DnnChartSeries(string name, ChartSeriesType type, ChartSeriesCollection parent) : base(name, type, parent)
 {
 }
Exemplo n.º 14
0
            public GitHubTrendsChart()
            {
                AutomationId = TrendsPageAutomationIds.TrendsChart;

                TotalViewsSeries = new TrendsAreaSeries("Views", nameof(DailyViewsModel.LocalDay), nameof(DailyViewsModel.TotalViews), nameof(BaseTheme.TotalViewsColor), TrendsPageAutomationIds.TotalViewsSeries);
                TotalViewsSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyViewsList));

                TotalUniqueViewsSeries = new TrendsAreaSeries("Unique Views", nameof(DailyViewsModel.LocalDay), nameof(DailyViewsModel.TotalUniqueViews), nameof(BaseTheme.TotalUniqueViewsColor), TrendsPageAutomationIds.TotalUniqueViewsSeries);
                TotalUniqueViewsSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyViewsList));

                TotalClonesSeries = new TrendsAreaSeries("Clones", nameof(DailyClonesModel.LocalDay), nameof(DailyClonesModel.TotalClones), nameof(BaseTheme.TotalClonesColor), TrendsPageAutomationIds.TotalClonesSeries);
                TotalClonesSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyClonesList));

                TotalUniqueClonesSeries = new TrendsAreaSeries("Unique Clones", nameof(DailyClonesModel.LocalDay), nameof(DailyClonesModel.TotalUniqueClones), nameof(BaseTheme.TotalUniqueClonesColor), TrendsPageAutomationIds.TotalUniqueClonesSeries);
                TotalUniqueClonesSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyClonesList));

                this.SetBinding(IsVisibleProperty, nameof(TrendsViewModel.IsChartVisible));

                ChartBehaviors = new ChartBehaviorCollection
                {
                    new ChartZoomPanBehavior(),
                    new ChartTrackballBehavior()
                };

                Series = new ChartSeriesCollection
                {
                    TotalViewsSeries,
                    TotalUniqueViewsSeries,
                    TotalClonesSeries,
                    TotalUniqueClonesSeries
                };

                var chartLegendLabelStyle = new ChartLegendLabelStyle();

                chartLegendLabelStyle.SetDynamicResource(ChartLegendLabelStyle.TextColorProperty, nameof(BaseTheme.ChartAxisTextColor));

                Legend = new ChartLegend
                {
                    AutomationId           = TrendsPageAutomationIds.TrendsChartLegend,
                    DockPosition           = LegendPlacement.Bottom,
                    ToggleSeriesVisibility = true,
                    IconWidth  = 20,
                    IconHeight = 20,
                    LabelStyle = chartLegendLabelStyle
                };

                var axisLabelStyle = new ChartAxisLabelStyle
                {
                    FontSize = 14
                };

                axisLabelStyle.SetDynamicResource(ChartAxisLabelStyle.TextColorProperty, nameof(BaseTheme.ChartAxisTextColor));

                var axisLineStyle = new ChartLineStyle();

                axisLineStyle.SetDynamicResource(ChartLineStyle.StrokeColorProperty, nameof(BaseTheme.ChartAxisLineColor));

                PrimaryAxis = new DateTimeAxis
                {
                    AutomationId   = TrendsPageAutomationIds.TrendsChartPrimaryAxis,
                    IntervalType   = DateTimeIntervalType.Days,
                    Interval       = 1,
                    RangePadding   = DateTimeRangePadding.Round,
                    LabelStyle     = axisLabelStyle,
                    AxisLineStyle  = axisLineStyle,
                    MajorTickStyle = new ChartAxisTickStyle {
                        StrokeColor = Color.Transparent
                    },
                    ShowMajorGridLines = false
                };
                PrimaryAxis.SetBinding(DateTimeAxis.MinimumProperty, nameof(TrendsViewModel.MinDateValue));
                PrimaryAxis.SetBinding(DateTimeAxis.MaximumProperty, nameof(TrendsViewModel.MaxDateValue));

                var secondaryAxisMajorTickStyle = new ChartAxisTickStyle();

                secondaryAxisMajorTickStyle.SetDynamicResource(ChartAxisTickStyle.StrokeColorProperty, nameof(BaseTheme.ChartAxisLineColor));

                SecondaryAxis = new NumericalAxis
                {
                    AutomationId       = TrendsPageAutomationIds.TrendsChartSecondaryAxis,
                    LabelStyle         = axisLabelStyle,
                    AxisLineStyle      = axisLineStyle,
                    MajorTickStyle     = secondaryAxisMajorTickStyle,
                    ShowMajorGridLines = false
                };
                SecondaryAxis.SetBinding(NumericalAxis.MinimumProperty, nameof(TrendsViewModel.DailyViewsClonesMinValue));
                SecondaryAxis.SetBinding(NumericalAxis.MaximumProperty, nameof(TrendsViewModel.DailyViewsClonesMaxValue));

                BackgroundColor = Color.Transparent;

                ChartPadding = new Thickness(0, 5, 0, 0);
            }
Exemplo n.º 15
0
            public GitHubTrendsChart()
            {
                TotalViewsSeries = new TrendsAreaSeries("Views", nameof(DailyViewsModel.LocalDay), nameof(DailyViewsModel.TotalViews), ColorConstants.DarkestBlue);
                TotalViewsSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyViewsList));

                TotalUniqueViewsSeries = new TrendsAreaSeries("Unique Views", nameof(DailyViewsModel.LocalDay), nameof(DailyViewsModel.TotalUniqueViews), ColorConstants.MediumBlue);
                TotalUniqueViewsSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyViewsList));

                TotalClonesSeries = new TrendsAreaSeries("Clones", nameof(DailyClonesModel.LocalDay), nameof(DailyClonesModel.TotalClones), ColorConstants.DarkNavyBlue);
                TotalClonesSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyClonesList));

                TotalUniqueClonesSeries = new TrendsAreaSeries("Unique Clones", nameof(DailyClonesModel.LocalDay), nameof(DailyClonesModel.TotalUniqueClones), ColorConstants.LightNavyBlue);
                TotalUniqueClonesSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyClonesList));

                this.SetBinding(IsVisibleProperty, nameof(TrendsViewModel.IsChartVisible));

                ChartBehaviors = new ChartBehaviorCollection
                {
                    new ChartZoomPanBehavior(),
                    new ChartTrackballBehavior()
                };

                Series = new ChartSeriesCollection
                {
                    TotalViewsSeries,
                    TotalUniqueViewsSeries,
                    TotalClonesSeries,
                    TotalUniqueClonesSeries
                };

                Legend = new ChartLegend
                {
                    DockPosition           = LegendPlacement.Bottom,
                    ToggleSeriesVisibility = true,
                    IconWidth  = 20,
                    IconHeight = 20,
                    LabelStyle = new ChartLegendLabelStyle {
                        TextColor = ColorConstants.DarkNavyBlue
                    }
                };

                var axisLabelStyle = new ChartAxisLabelStyle
                {
                    TextColor = ColorConstants.DarkNavyBlue,
                    FontSize  = 14
                };
                var axisLineStyle = new ChartLineStyle {
                    StrokeColor = ColorConstants.LightNavyBlue
                };

                PrimaryAxis = new DateTimeAxis
                {
                    IntervalType   = DateTimeIntervalType.Days,
                    Interval       = 1,
                    RangePadding   = DateTimeRangePadding.Round,
                    LabelStyle     = axisLabelStyle,
                    AxisLineStyle  = axisLineStyle,
                    MajorTickStyle = new ChartAxisTickStyle {
                        StrokeColor = Color.Transparent
                    },
                    ShowMajorGridLines = false
                };
                PrimaryAxis.SetBinding(DateTimeAxis.MinimumProperty, nameof(TrendsViewModel.MinDateValue));
                PrimaryAxis.SetBinding(DateTimeAxis.MaximumProperty, nameof(TrendsViewModel.MaxDateValue));

                SecondaryAxis = new NumericalAxis
                {
                    LabelStyle     = axisLabelStyle,
                    AxisLineStyle  = axisLineStyle,
                    MajorTickStyle = new ChartAxisTickStyle {
                        StrokeColor = ColorConstants.LightNavyBlue
                    },
                    ShowMajorGridLines = false
                };
                SecondaryAxis.SetBinding(NumericalAxis.MinimumProperty, nameof(TrendsViewModel.DailyViewsClonesMinValue));
                SecondaryAxis.SetBinding(NumericalAxis.MaximumProperty, nameof(TrendsViewModel.DailyViewsClonesMaxValue));

                BackgroundColor = Color.Transparent;

                ChartPadding = new Thickness(0, 5, 0, 0);
                Margin       = Device.RuntimePlatform is Device.iOS ? new Thickness(0, 5, 0, 15) : new Thickness(0, 5, 0, 0);
            }
Exemplo n.º 16
0
            public Chart()
            {
                Margin       = 0;
                ChartPadding = new Thickness(0, 24, 0, 4);

                BackgroundColor = Color.Transparent;

                AutomationId = TrendsPageAutomationIds.TrendsChart;

                TotalViewsSeries = new TrendsAreaSeries(TrendsChartConstants.TotalViewsTitle, nameof(DailyViewsModel.LocalDay), nameof(DailyViewsModel.TotalViews), nameof(BaseTheme.TotalViewsColor));
                TotalViewsSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyViewsList));
                TotalViewsSeries.SetBinding(ChartSeries.IsVisibleProperty, nameof(TrendsViewModel.IsViewsSeriesVisible));

                TotalUniqueViewsSeries = new TrendsAreaSeries(TrendsChartConstants.UniqueViewsTitle, nameof(DailyViewsModel.LocalDay), nameof(DailyViewsModel.TotalUniqueViews), nameof(BaseTheme.TotalUniqueViewsColor));
                TotalUniqueViewsSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyViewsList));
                TotalUniqueViewsSeries.SetBinding(ChartSeries.IsVisibleProperty, nameof(TrendsViewModel.IsUniqueViewsSeriesVisible));

                TotalClonesSeries = new TrendsAreaSeries(TrendsChartConstants.TotalClonesTitle, nameof(DailyClonesModel.LocalDay), nameof(DailyClonesModel.TotalClones), nameof(BaseTheme.TotalClonesColor));
                TotalClonesSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyClonesList));
                TotalClonesSeries.SetBinding(ChartSeries.IsVisibleProperty, nameof(TrendsViewModel.IsClonesSeriesVisible));

                TotalUniqueClonesSeries = new TrendsAreaSeries(TrendsChartConstants.UniqueClonesTitle, nameof(DailyClonesModel.LocalDay), nameof(DailyClonesModel.TotalUniqueClones), nameof(BaseTheme.TotalUniqueClonesColor));
                TotalUniqueClonesSeries.SetBinding(ChartSeries.ItemsSourceProperty, nameof(TrendsViewModel.DailyClonesList));
                TotalUniqueClonesSeries.SetBinding(ChartSeries.IsVisibleProperty, nameof(TrendsViewModel.IsUniqueClonesSeriesVisible));

                ChartBehaviors = new ChartBehaviorCollection
                {
                    new ChartZoomPanBehavior(),
                    new ChartTrackballBehavior()
                };

                Series = new ChartSeriesCollection
                {
                    TotalViewsSeries,
                    TotalUniqueViewsSeries,
                    TotalClonesSeries,
                    TotalUniqueClonesSeries,
                };

                var primaryAxisLabelStyle = new ChartAxisLabelStyle
                {
                    FontSize   = 9,
                    FontFamily = FontFamilyConstants.RobotoRegular,
                    Margin     = new Thickness(2, 4, 2, 0)
                };

                primaryAxisLabelStyle.SetDynamicResource(ChartLabelStyle.TextColorProperty, nameof(BaseTheme.ChartAxisTextColor));

                var axisLineStyle = new ChartLineStyle()
                {
                    StrokeWidth = 1.51
                };

                axisLineStyle.SetDynamicResource(ChartLineStyle.StrokeColorProperty, nameof(BaseTheme.ChartAxisLineColor));

                PrimaryAxis = new DateTimeAxis
                {
                    AutomationId   = TrendsPageAutomationIds.TrendsChartPrimaryAxis,
                    IntervalType   = DateTimeIntervalType.Days,
                    Interval       = 1,
                    RangePadding   = DateTimeRangePadding.Round,
                    LabelStyle     = primaryAxisLabelStyle,
                    AxisLineStyle  = axisLineStyle,
                    MajorTickStyle = new ChartAxisTickStyle {
                        StrokeColor = Color.Transparent
                    },
                    ShowMajorGridLines = false,
                };
                PrimaryAxis.SetBinding(DateTimeAxis.MinimumProperty, nameof(TrendsViewModel.MinDateValue));
                PrimaryAxis.SetBinding(DateTimeAxis.MaximumProperty, nameof(TrendsViewModel.MaxDateValue));

                var secondaryAxisMajorTickStyle = new ChartAxisTickStyle();

                secondaryAxisMajorTickStyle.SetDynamicResource(ChartAxisTickStyle.StrokeColorProperty, nameof(BaseTheme.ChartAxisLineColor));

                var secondaryAxisLabelStyle = new ChartAxisLabelStyle
                {
                    FontSize   = 12,
                    FontFamily = FontFamilyConstants.RobotoRegular,
                };

                secondaryAxisLabelStyle.SetDynamicResource(ChartLabelStyle.TextColorProperty, nameof(BaseTheme.ChartAxisTextColor));

                SecondaryAxis = new NumericalAxis
                {
                    AutomationId       = TrendsPageAutomationIds.TrendsChartSecondaryAxis,
                    LabelStyle         = secondaryAxisLabelStyle,
                    AxisLineStyle      = axisLineStyle,
                    MajorTickStyle     = secondaryAxisMajorTickStyle,
                    ShowMajorGridLines = false
                };
                SecondaryAxis.SetBinding(NumericalAxis.MinimumProperty, nameof(TrendsViewModel.DailyViewsClonesMinValue));
                SecondaryAxis.SetBinding(NumericalAxis.MaximumProperty, nameof(TrendsViewModel.DailyViewsClonesMaxValue));
            }
Exemplo n.º 17
0
 public DnnChartSeries(string name, ChartSeriesType type, ChartSeriesCollection parent) : base(name, type, parent)
 {
 }
Exemplo n.º 18
0
 public DnnChartSeries(string seriesName, ChartSeriesType chartSeriesType, ChartSeriesCollection parent, ChartYAxisType yAxisType, StyleSeries style)
     : base(seriesName, chartSeriesType, parent, yAxisType, style)
 {
 }
Exemplo n.º 19
0
 public DnnChartSeries(string seriesName, ChartSeriesType chartSeriesType, ChartSeriesCollection parent, ChartYAxisType yAxisType, StyleSeries style)
     : base(seriesName, chartSeriesType, parent, yAxisType, style)
 {
 }
Exemplo n.º 20
0
 public DnnChartSeries(ChartSeriesCollection parent) : base(parent)
 {
 }
Exemplo n.º 21
0
 public DnnChartSeries(string seriesName, ChartSeriesType chartSeriesType, ChartSeriesCollection parent, ChartYAxisType yAxisType, StyleSeries style, string dataYColumn, string dataXColumn,
                       string dataYColumn2, string dataXColumn2, string dataYColumn3, string dataYColumn4, string dataLabelsColumn)
     : base(seriesName, chartSeriesType, parent, yAxisType, style, dataYColumn, dataXColumn, dataYColumn2, dataXColumn2, dataYColumn3, dataYColumn4, dataLabelsColumn)
 {
 }