From 781e9b4ec531b1d9e468cb2e88d7304f2e6d3bf0 Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Thu, 28 Mar 2024 20:11:58 -0600 Subject: [PATCH] added chart type property --- .../Visualizations/AreaChartVisualization.cs | 34 ++-- .../Visualizations/BarChartVisualization.cs | 34 ++-- .../Visualizations/BubbleVisualization.cs | 2 +- .../BulletGraphVisualization.cs | 2 +- .../CandleStickVisualization.cs | 34 ++-- .../Visualizations/ChoroplethVisualization.cs | 98 +++++------ .../CircularGaugeVisualization.cs | 34 ++-- .../ColumnChartVisualization.cs | 34 ++-- .../Visualizations/ComboChartVisualization.cs | 64 ++++---- .../Visualizations/CustomVisualization.cs | 78 ++++----- .../DoughnutChartVisualization.cs | 34 ++-- .../Visualizations/Enums/ChartType.cs | 71 ++++---- .../Visualizations/Enums/RdashChartType.cs | 31 ++++ .../FunnelChartVisualization.cs | 34 ++-- .../Visualizations/GridVisualization.cs | 52 +++--- .../Visualizations/ImageVisualization.cs | 58 +++---- .../Interfaces/IVisualization.cs | 29 ++-- .../Visualizations/KpiTargetVisualization.cs | 101 ++++++------ .../Visualizations/KpiTimeVisualization.cs | 89 +++++----- .../Visualizations/LineChartVisualization.cs | 34 ++-- .../LinearGaugeVisualization.cs | 34 ++-- .../Visualizations/OHLCVisualization.cs | 34 ++-- .../Visualizations/PieChartVisualization.cs | 34 ++-- .../Visualizations/PivotVisualization.cs | 71 ++++---- .../Visualizations/RadialVisualization.cs | 34 ++-- .../Visualizations/ScatterMapVisualization.cs | 152 +++++++++--------- .../Visualizations/ScatterVisualization.cs | 64 ++++---- .../AreaChartVisualizationSettings.cs | 20 +-- .../Settings/BarChartVisualizationSettings.cs | 20 +-- .../Settings/BubbleVisualizationSettings.cs | 20 +-- .../CandleStickVisualizationSettings.cs | 20 +-- .../ChartVisualizationSettingsBase.cs | 44 ++--- .../ColumnChartVisualizationSettings.cs | 20 +-- .../ComboChartVisualizationSettings.cs | 134 +++++++-------- .../DoughnutChartVisualizationSettings.cs | 20 +-- .../FunnelChartVisualizationSettings.cs | 20 +-- .../LineChartVisualizationSettings.cs | 20 +-- .../Settings/OHLCVisualizationSettings.cs | 20 +-- .../Settings/PieChartVisualizationSettings.cs | 20 +-- .../Settings/RadialVisualizationSettings.cs | 40 ++--- .../Settings/ScatterVisualizationSettings.cs | 60 +++---- .../SharedChartVisualizationSettings.cs | 122 +++++++------- .../SplineAreaChartVisualizationSettings.cs | 20 +-- .../SplineChartVisualizationSettings.cs | 20 +-- .../StackedAreaChartVisualizationSettings.cs | 20 +-- .../StackedBarChartVisualizationSettings.cs | 20 +-- ...StackedColumnChartVisualizationSettings.cs | 20 +-- .../StepAreaChartVisualizationSettings.cs | 20 +-- .../StepLineChartVisualizationSettings.cs | 20 +-- .../TimeSeriesVisualizationSettings.cs | 20 +-- .../Visualizations/SparklineVisualization.cs | 89 +++++----- .../SplineAreaChartVisualization.cs | 34 ++-- .../SplineChartVisualization.cs | 34 ++-- .../StackedAreaChartVisualization.cs | 34 ++-- .../StackedBarChartVisualization.cs | 34 ++-- .../StackedColumnChartVisualization.cs | 34 ++-- .../StepAreaChartVisualization.cs | 34 ++-- .../StepLineChartVisualization.cs | 32 ++-- .../Visualizations/TextBoxVisualization.cs | 1 + .../Visualizations/TextViewVisualization.cs | 52 +++--- .../Visualizations/TextVisualization.cs | 34 ++-- .../Visualizations/TimeSeriesVisualization.cs | 100 ++++++------ .../Visualizations/TreeMapVisualization.cs | 58 +++---- .../Visualizations/Visualization.cs | 115 ++++++------- 64 files changed, 1436 insertions(+), 1379 deletions(-) create mode 100644 src/Reveal.Sdk.Dom/Visualizations/Enums/RdashChartType.cs diff --git a/src/Reveal.Sdk.Dom/Visualizations/AreaChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/AreaChartVisualization.cs index cac236a5..8be0c2d1 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/AreaChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/AreaChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The area chart visualization renders as a collection of points connected by straight line segments with the area below the line filled in. Values are represented on the y-axis and categories are displayed on the x-axis. This chart emphasize the amount of change over a period of time or compare multiple items as well as the relationship of parts of a whole by displaying the total of the plotted values. Therefore, they are often chronological, showing a change of quantity e.g. accumulation of a commodity over time. - /// - public sealed class AreaChartVisualization : CategoryVisualizationBase - { - internal AreaChartVisualization() : this(null) { } - + /// + public sealed class AreaChartVisualization : CategoryVisualizationBase + { + internal AreaChartVisualization() : this(null) { } + /// /// Creates an area chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public AreaChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public AreaChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates an area chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public AreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public AreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Area; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/BarChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/BarChartVisualization.cs index e727cb63..2198b60d 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/BarChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/BarChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The bar chart visualization is among the most common category chart types used to quickly compare frequency, count, total, or  average of data in different categories with data encoded by horizontal bars with equal heights but different lengths. This chart is ideal for showing variations in the value of an item over time. Data is represented using a collection of rectangles that extend from the left to right of the chart towards the values of data points. - /// - public sealed class BarChartVisualization : CategoryVisualizationBase - { - internal BarChartVisualization() : this(null) { } - + /// + public sealed class BarChartVisualization : CategoryVisualizationBase + { + internal BarChartVisualization() : this(null) { } + /// /// Creates a bar chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public BarChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public BarChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a bar chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public BarChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public BarChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Bar; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/BubbleVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/BubbleVisualization.cs index c01b9f38..7ade3917 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/BubbleVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/BubbleVisualization.cs @@ -24,7 +24,7 @@ public BubbleVisualization(DataSourceItem dataSourceItem) : this(null, dataSourc /// /// The string to use as the visualization's title. /// The data soure item used to represent a dataset. - public BubbleVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } + public BubbleVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Bubble; } [JsonProperty(Order = 7)] BubbleVisualizationDataSpec VisualizationDataSpec { get; set; } = new BubbleVisualizationDataSpec(); diff --git a/src/Reveal.Sdk.Dom/Visualizations/BulletGraphVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/BulletGraphVisualization.cs index a7e042c2..81c1d07a 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/BulletGraphVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/BulletGraphVisualization.cs @@ -23,7 +23,7 @@ public BulletGraphVisualization(DataSourceItem dataSourceItem) : this(null, data /// /// The string to use as the visualization's title. /// The data soure item used to represent a dataset. - public BulletGraphVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } + public BulletGraphVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.BulletGraph; } [JsonIgnore] public List Targets { get { return VisualizationDataSpec.Target; } } diff --git a/src/Reveal.Sdk.Dom/Visualizations/CandleStickVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/CandleStickVisualization.cs index 41e0e0a7..e4ce2d59 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/CandleStickVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/CandleStickVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The candlestick visualization is used for the technical analysis of the price ranges. A candlestick chart compares the high and low prices of a day to the open and close of the ticker symbol. - /// - public sealed class CandleStickVisualization : FinancialVisualizationBase - { - internal CandleStickVisualization() : this(null) { } - + /// + public sealed class CandleStickVisualization : FinancialVisualizationBase + { + internal CandleStickVisualization() : this(null) { } + /// /// Creates a candlestick visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public CandleStickVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public CandleStickVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a candlestick visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public CandleStickVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public CandleStickVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Candlestick; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/ChoroplethVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/ChoroplethVisualization.cs index 5babedd5..b0edf719 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/ChoroplethVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/ChoroplethVisualization.cs @@ -1,58 +1,58 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The choropleth visualization is used to display geo-spatial data using shape polygons in a geographic context. This type of visualization is often used to render shapes of countries or regions defined by geographic locations. - /// - public sealed class ChoroplethVisualization : TabularVisualizationBase, IValues, IMap - { - internal ChoroplethVisualization() : this(null) { } - + /// + public sealed class ChoroplethVisualization : TabularVisualizationBase, IValues, IMap + { + internal ChoroplethVisualization() : this(null) { } + /// /// Creates a choropleth visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public ChoroplethVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public ChoroplethVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a choropleth visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public ChoroplethVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - ChoroplethVisualizationDataSpec VisualizationDataSpec { get; set; } = new ChoroplethVisualizationDataSpec(); - - [JsonIgnore] - public string Map - { - get { return Settings.Region; } - set { Settings.Region = value; } - } - - [JsonIgnore] - public List Locations - { - get { return VisualizationDataSpec.Rows; } - } - - [JsonIgnore] - public DimensionColumn MapColor - { - get { return VisualizationDataSpec.MapColor; } - set { VisualizationDataSpec.MapColor = value; } - } - - [JsonIgnore] - public List Values - { - get { return VisualizationDataSpec.Value; } - } - } -} + /// The data soure item used to represent a dataset. + public ChoroplethVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Choropleth; } + + [JsonProperty(Order = 7)] + ChoroplethVisualizationDataSpec VisualizationDataSpec { get; set; } = new ChoroplethVisualizationDataSpec(); + + [JsonIgnore] + public string Map + { + get { return Settings.Region; } + set { Settings.Region = value; } + } + + [JsonIgnore] + public List Locations + { + get { return VisualizationDataSpec.Rows; } + } + + [JsonIgnore] + public DimensionColumn MapColor + { + get { return VisualizationDataSpec.MapColor; } + set { VisualizationDataSpec.MapColor = value; } + } + + [JsonIgnore] + public List Values + { + get { return VisualizationDataSpec.Value; } + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/CircularGaugeVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/CircularGaugeVisualization.cs index f2cf2224..c81101c8 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/CircularGaugeVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/CircularGaugeVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The circular gauge visualization displays a semi circle that contains minimum and maximum thresholds along with the current value. The circular gauge paints the scale background with the color of the current range. - /// - public sealed class CircularGaugeVisualization : SingleGaugeVisualizationBase - { - internal CircularGaugeVisualization() : this(null) { } - + /// + public sealed class CircularGaugeVisualization : SingleGaugeVisualizationBase + { + internal CircularGaugeVisualization() : this(null) { } + /// /// Creates a circular gauge visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public CircularGaugeVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public CircularGaugeVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a circular gauge visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public CircularGaugeVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public CircularGaugeVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.CircularGauge; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/ColumnChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/ColumnChartVisualization.cs index c434b5e7..9bfd98d7 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/ColumnChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/ColumnChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The column chart visualization is among the most common category chart types used to quickly compare frequency, count, total, or average of data in different categories with data encoded by columns with equal widths but different heights. These columns extend from the bottom to top of the chart towards the values of data points. This chart emphasizes the amount of change over a period of time or compares multiple items. - /// - public sealed class ColumnChartVisualization : CategoryVisualizationBase - { - internal ColumnChartVisualization() : this(null) { } - + /// + public sealed class ColumnChartVisualization : CategoryVisualizationBase + { + internal ColumnChartVisualization() : this(null) { } + /// /// Creates a column chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public ColumnChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public ColumnChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a column chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public ColumnChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public ColumnChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Column; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/ComboChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/ComboChartVisualization.cs index 5e2cf18a..c0ab1e24 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/ComboChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/ComboChartVisualization.cs @@ -1,41 +1,41 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The combo chart visualization is used to combine two different category charts into one visualization. This visualization type only supports adding these chart types; column, stacked column, area, line, step area, step line, and spline area. - /// - public sealed class ComboChartVisualization : TabularVisualizationBase, ILabels - { - internal ComboChartVisualization() : this(null) { } - + /// + public sealed class ComboChartVisualization : TabularVisualizationBase, ILabels + { + internal ComboChartVisualization() : this(null) { } + /// /// Creates a combo chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public ComboChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public ComboChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a combo chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public ComboChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - CompositeChartVisualizationDataSpec VisualizationDataSpec { get; set; } = new CompositeChartVisualizationDataSpec(); - - [JsonIgnore] - public List Chart1 { get { return VisualizationDataSpec.Chart1; } } - - [JsonIgnore] - public List Chart2 { get { return VisualizationDataSpec.Chart2; } } - - [JsonIgnore] - public List Labels { get { return VisualizationDataSpec.Rows; } } - } -} + /// The data soure item used to represent a dataset. + public ComboChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Combo; } + + [JsonProperty(Order = 7)] + CompositeChartVisualizationDataSpec VisualizationDataSpec { get; set; } = new CompositeChartVisualizationDataSpec(); + + [JsonIgnore] + public List Chart1 { get { return VisualizationDataSpec.Chart1; } } + + [JsonIgnore] + public List Chart2 { get { return VisualizationDataSpec.Chart2; } } + + [JsonIgnore] + public List Labels { get { return VisualizationDataSpec.Rows; } } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/CustomVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/CustomVisualization.cs index 318b4b40..8cf70d60 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/CustomVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/CustomVisualization.cs @@ -1,48 +1,48 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The custom visualizion is used to support visualizations not supported out of the box. - /// - public sealed class CustomVisualization : TabularVisualizationBase, IRows, IValues, IColumns - { - internal CustomVisualization() : this(null) { } - + /// + public sealed class CustomVisualization : TabularVisualizationBase, IRows, IValues, IColumns + { + internal CustomVisualization() : this(null) { } + /// /// Creates a custom visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public CustomVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public CustomVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a custom visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public CustomVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - PivotVisualizationDataSpec VisualizationDataSpec { get; set; } = new PivotVisualizationDataSpec(); - - [JsonIgnore] - public List Rows { get { return VisualizationDataSpec.Rows; } } - - [JsonIgnore] - public List Values { get { return VisualizationDataSpec.Values; } } - - [JsonIgnore] - public List Columns { get { return VisualizationDataSpec.Columns; } } - - [JsonIgnore] - public string Url - { - get { return Settings.Url; } - set { Settings.Url = value; } - } - } -} + /// The data soure item used to represent a dataset. + public CustomVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Custom; } + + [JsonProperty(Order = 7)] + PivotVisualizationDataSpec VisualizationDataSpec { get; set; } = new PivotVisualizationDataSpec(); + + [JsonIgnore] + public List Rows { get { return VisualizationDataSpec.Rows; } } + + [JsonIgnore] + public List Values { get { return VisualizationDataSpec.Values; } } + + [JsonIgnore] + public List Columns { get { return VisualizationDataSpec.Columns; } } + + [JsonIgnore] + public string Url + { + get { return Settings.Url; } + set { Settings.Url = value; } + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/DoughnutChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/DoughnutChartVisualization.cs index a06abf5e..3e667ea7 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/DoughnutChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/DoughnutChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The doughnut visualization is used to proportionally illustrate the occurrences of a variable by drawing arc segments around a center point that is empty, like a doughnut. - /// - public sealed class DoughnutChartVisualization : SingleValueLabelsVisualizationBase - { - internal DoughnutChartVisualization() : this(null) { } - + /// + public sealed class DoughnutChartVisualization : SingleValueLabelsVisualizationBase + { + internal DoughnutChartVisualization() : this(null) { } + /// /// Creates a doughnut chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public DoughnutChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public DoughnutChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a doughnut chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public DoughnutChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public DoughnutChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Doughnut; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Enums/ChartType.cs b/src/Reveal.Sdk.Dom/Visualizations/Enums/ChartType.cs index 873820e6..0ea04212 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Enums/ChartType.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Enums/ChartType.cs @@ -1,27 +1,44 @@ -namespace Reveal.Sdk.Dom.Visualizations -{ - internal enum ChartType - { - Column, - Line, - Bar, - Area, - Spline, - SplineArea, - StepArea, - StepLine, - Composite, - Bubble, - Candlestick, - OHLC, - Pie, - RadialLines, - Scatter, - StackedColumn, - StackedArea, - StackedBar, - Doughnut, - Funnel, - TimeSeries - } -} +namespace Reveal.Sdk.Dom.Visualizations +{ + public enum ChartType + { + Area, + Bar, + Bubble, + BulletGraph, + Candlestick, + Choropleth, + CircularGauge, + Column, + Combo, + Custom, + Doughnut, + Funnel, + Grid, + Image, + KpiTarget, + KpiTime, + Line, + LinearGauge, + OHLC, + Pie, + Pivot, + Radial, + Scatter, + ScatterMap, + Sparkline, + Spline, + SplineArea, + StackedArea, + StackedBar, + StackedColumn, + StepArea, + StepLine, + Text, + TextBox, + TextView, + TimeSeries, + TreeMap, + Unknown + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Enums/RdashChartType.cs b/src/Reveal.Sdk.Dom/Visualizations/Enums/RdashChartType.cs new file mode 100644 index 00000000..9ef99f3d --- /dev/null +++ b/src/Reveal.Sdk.Dom/Visualizations/Enums/RdashChartType.cs @@ -0,0 +1,31 @@ +namespace Reveal.Sdk.Dom.Visualizations +{ + /// + /// These chart types are used internally to map to the JSON properties on the VisualizationSettings element of the RDASH schema. + /// DO NOT USE IN PUBLIC API + /// + internal enum RdashChartType + { + Column, + Line, + Bar, + Area, + Spline, + SplineArea, + StepArea, + StepLine, + Composite, + Bubble, + Candlestick, + OHLC, + Pie, + RadialLines, + Scatter, + StackedColumn, + StackedArea, + StackedBar, + Doughnut, + Funnel, + TimeSeries + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/FunnelChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/FunnelChartVisualization.cs index 04cb6f52..fb49d6c4 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/FunnelChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/FunnelChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The funnel chart visualization is used to display quantities as percentages of a whole, much like a pie chart. Funnel charts are commonly used to display quantitative data in relation to stages of a process. - /// - public sealed class FunnelChartVisualization : SingleValueLabelsVisualizationBase - { - internal FunnelChartVisualization() : this(null) { } - + /// + public sealed class FunnelChartVisualization : SingleValueLabelsVisualizationBase + { + internal FunnelChartVisualization() : this(null) { } + /// /// Creates a funnel chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public FunnelChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public FunnelChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a funnel chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public FunnelChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public FunnelChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Funnel; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs index ab2586ca..c47f661d 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs @@ -1,35 +1,35 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The grid view visualization is used for displaying data which presents the information in a table. - /// - public sealed class GridVisualization : TabularVisualizationBase, ITabularColumns - { - internal GridVisualization() : this(null) { } - + /// + public sealed class GridVisualization : TabularVisualizationBase, ITabularColumns + { + internal GridVisualization() : this(null) { } + /// /// Creates a grid visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public GridVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public GridVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a grid visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public GridVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonIgnore] - public List Columns { get { return VisualizationDataSpec.Columns; } } - - [JsonProperty(Order = 7)] - GridVisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec(); - } -} + /// The data soure item used to represent a dataset. + public GridVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Grid; } + + [JsonIgnore] + public List Columns { get { return VisualizationDataSpec.Columns; } } + + [JsonProperty(Order = 7)] + GridVisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec(); + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/ImageVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/ImageVisualization.cs index d1a6f61d..558a14a8 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/ImageVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/ImageVisualization.cs @@ -1,38 +1,38 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The image visualization is used for displaying images, PDFs, or web content. - /// - public sealed class ImageVisualization : TabularVisualizationBase - { - internal ImageVisualization() : this(null) { } - + /// + public sealed class ImageVisualization : TabularVisualizationBase + { + internal ImageVisualization() : this(null) { } + /// /// Creates a image visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public ImageVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public ImageVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a image visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public ImageVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonIgnore] - public TabularColumn Url - { - get { return VisualizationDataSpec.UrlColumn; } - set { VisualizationDataSpec.UrlColumn = value; } - } - - [JsonProperty(Order = 7)] - AssetVisualizationDataSpec VisualizationDataSpec { get; set; } = new AssetVisualizationDataSpec(); - } -} + /// The data soure item used to represent a dataset. + public ImageVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Image; } + + [JsonIgnore] + public TabularColumn Url + { + get { return VisualizationDataSpec.UrlColumn; } + set { VisualizationDataSpec.UrlColumn = value; } + } + + [JsonProperty(Order = 7)] + AssetVisualizationDataSpec VisualizationDataSpec { get; set; } = new AssetVisualizationDataSpec(); + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Interfaces/IVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/Interfaces/IVisualization.cs index ecc819b8..cbf97297 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Interfaces/IVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Interfaces/IVisualization.cs @@ -1,15 +1,16 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Core.Serialization.Converters; - -namespace Reveal.Sdk.Dom.Visualizations -{ - [JsonConverter(typeof(VisualizationConverter))] - public interface IVisualization - { - string Id { get; set; } - string Title { get; set; } - bool IsTitleVisible { get; set; } - int ColumnSpan { get; set; } - int RowSpan { get; set; } - } +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Core.Serialization.Converters; + +namespace Reveal.Sdk.Dom.Visualizations +{ + [JsonConverter(typeof(VisualizationConverter))] + public interface IVisualization + { + string Id { get; set; } + ChartType ChartType { get; } + string Title { get; set; } + bool IsTitleVisible { get; set; } + int ColumnSpan { get; set; } + int RowSpan { get; set; } + } } \ No newline at end of file diff --git a/src/Reveal.Sdk.Dom/Visualizations/KpiTargetVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/KpiTargetVisualization.cs index aa8e7159..f3960046 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/KpiTargetVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/KpiTargetVisualization.cs @@ -1,60 +1,61 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The KPI vs target visualization is used for measuring performance against a target through a prior time period. - /// - public sealed class KpiTargetVisualization : TabularVisualizationBase, ITargets, IDate, IValues, ICategories - { - internal KpiTargetVisualization() : this(null) { } - + /// + public sealed class KpiTargetVisualization : TabularVisualizationBase, ITargets, IDate, IValues, ICategories + { + internal KpiTargetVisualization() : this(null) { } + /// /// Creates a KPI vs target visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public KpiTargetVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public KpiTargetVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a KPI vs target visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public KpiTargetVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) - { - Settings.VisualizationDataSpec = VisualizationDataSpec; - } - - [JsonIgnore] - public DimensionColumn Date - { - get { return VisualizationDataSpec.Date; } - set { VisualizationDataSpec.Date = value; } - } - - [JsonIgnore] - public List Values - { - get { return VisualizationDataSpec.Value; } - } - - [JsonIgnore] - public List Categories - { - get { return VisualizationDataSpec.Rows; } - } - - [JsonIgnore] - public List Targets - { - get { return VisualizationDataSpec.Target; } - } - - [JsonProperty(Order = 7)] - IndicatorTargetVisualizationDataSpec VisualizationDataSpec { get; set; } = new IndicatorTargetVisualizationDataSpec(); - } + /// The data soure item used to represent a dataset. + public KpiTargetVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) + { + Settings.VisualizationDataSpec = VisualizationDataSpec; + ChartType = ChartType.KpiTarget; + } + + [JsonIgnore] + public DimensionColumn Date + { + get { return VisualizationDataSpec.Date; } + set { VisualizationDataSpec.Date = value; } + } + + [JsonIgnore] + public List Values + { + get { return VisualizationDataSpec.Value; } + } + + [JsonIgnore] + public List Categories + { + get { return VisualizationDataSpec.Rows; } + } + + [JsonIgnore] + public List Targets + { + get { return VisualizationDataSpec.Target; } + } + + [JsonProperty(Order = 7)] + IndicatorTargetVisualizationDataSpec VisualizationDataSpec { get; set; } = new IndicatorTargetVisualizationDataSpec(); + } } \ No newline at end of file diff --git a/src/Reveal.Sdk.Dom/Visualizations/KpiTimeVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/KpiTimeVisualization.cs index 9a114ab0..b515235f 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/KpiTimeVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/KpiTimeVisualization.cs @@ -1,54 +1,55 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The KPI vs time visualization is used for measuring performance of a value field compared against a prior time period. - /// - public sealed class KpiTimeVisualization : TabularVisualizationBase, IDate, IValues, ICategories - { - internal KpiTimeVisualization() : this(null) { } - + /// + public sealed class KpiTimeVisualization : TabularVisualizationBase, IDate, IValues, ICategories + { + internal KpiTimeVisualization() : this(null) { } + /// /// Creates a KPI vs time visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public KpiTimeVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public KpiTimeVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a KPI vs time visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public KpiTimeVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) - { - Settings.VisualizationDataSpec = VisualizationDataSpec; - } - - [JsonIgnore] - public DimensionColumn Date - { - get { return VisualizationDataSpec.Date; } - set { VisualizationDataSpec.Date = value; } - } - - [JsonIgnore] - public List Values - { - get { return VisualizationDataSpec.Value; } - } - - [JsonIgnore] - public List Categories - { - get { return VisualizationDataSpec.Rows; } - } - - [JsonProperty(Order = 7)] - IndicatorVisualizationDataSpec VisualizationDataSpec { get; set; } = new IndicatorVisualizationDataSpec(); - } + /// The data soure item used to represent a dataset. + public KpiTimeVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) + { + Settings.VisualizationDataSpec = VisualizationDataSpec; + ChartType = ChartType.KpiTime; + } + + [JsonIgnore] + public DimensionColumn Date + { + get { return VisualizationDataSpec.Date; } + set { VisualizationDataSpec.Date = value; } + } + + [JsonIgnore] + public List Values + { + get { return VisualizationDataSpec.Value; } + } + + [JsonIgnore] + public List Categories + { + get { return VisualizationDataSpec.Rows; } + } + + [JsonProperty(Order = 7)] + IndicatorVisualizationDataSpec VisualizationDataSpec { get; set; } = new IndicatorVisualizationDataSpec(); + } } \ No newline at end of file diff --git a/src/Reveal.Sdk.Dom/Visualizations/LineChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/LineChartVisualization.cs index 460a7e5c..44104ea4 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/LineChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/LineChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The line chart visualization is used to show the continuous data values represented by points connected by straight line segments of one or more quantities over a period of time. It’s often used to show trends and perform comparative analysis. - /// - public sealed class LineChartVisualization : CategoryVisualizationBase - { - internal LineChartVisualization() : this(null) { } - + /// + public sealed class LineChartVisualization : CategoryVisualizationBase + { + internal LineChartVisualization() : this(null) { } + /// /// Creates a line chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public LineChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public LineChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a line chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public LineChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public LineChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Line; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/LinearGaugeVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/LinearGaugeVisualization.cs index 7765fde2..95c876f2 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/LinearGaugeVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/LinearGaugeVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The linear gauge visualization is used for displaying a single value, or a list of values, comparing them with range thresholds. - /// - public sealed class LinearGaugeVisualization : LinearGaugeVisualizationBase - { - internal LinearGaugeVisualization() : this(null) { } - + /// + public sealed class LinearGaugeVisualization : LinearGaugeVisualizationBase + { + internal LinearGaugeVisualization() : this(null) { } + /// /// Creates a linear gauge visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public LinearGaugeVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public LinearGaugeVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a linear gauge visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public LinearGaugeVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public LinearGaugeVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.LinearGauge; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/OHLCVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/OHLCVisualization.cs index 7272eb89..15858087 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/OHLCVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/OHLCVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The OHLC visualization is used for the technical analysis of the price ranges. The visualization is meant to show the opening, high, low and closing prices for any financial data. - /// - public sealed class OHLCVisualization : FinancialVisualizationBase - { - internal OHLCVisualization() : this(null) { } - + /// + public sealed class OHLCVisualization : FinancialVisualizationBase + { + internal OHLCVisualization() : this(null) { } + /// /// Creates a OHLC visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public OHLCVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public OHLCVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a OHLC visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public OHLCVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public OHLCVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.OHLC; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/PieChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/PieChartVisualization.cs index 039d02f0..f1cf9de0 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/PieChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/PieChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The pie chart visualization is used to show a part-to-whole chart that shows how categories (parts) of a data set add up to a total (whole) value. - /// - public sealed class PieChartVisualization : SingleValueLabelsVisualizationBase - { - internal PieChartVisualization() : this(null) { } - + /// + public sealed class PieChartVisualization : SingleValueLabelsVisualizationBase + { + internal PieChartVisualization() : this(null) { } + /// /// Creates a pie chart visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public PieChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public PieChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a pie chart visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public PieChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public PieChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Pie; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/PivotVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/PivotVisualization.cs index c23fc573..60b4fab5 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/PivotVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/PivotVisualization.cs @@ -1,45 +1,46 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The pivot table visualization is used as a data summarization tool, which among other functions allows you to automatically count, average and total the data stored in a table like format, typically grouped by values. - /// - public sealed class PivotVisualization : TabularVisualizationBase, IValues, IRows, IColumns - { - internal PivotVisualization() : this(null) { } - + /// + public sealed class PivotVisualization : TabularVisualizationBase, IValues, IRows, IColumns + { + internal PivotVisualization() : this(null) { } + /// /// Creates a pivot table visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public PivotVisualization(DataSourceItem dataSourceItem) : base(string.Empty, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public PivotVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a pivot table visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public PivotVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) - { - //this is a workaround because the json schemea has this property on the VisualizationDataSpec and not on the VisualizationSettings where it belongs - Settings._visualizationDataSpec = VisualizationDataSpec; - } - - [JsonIgnore] - public List Columns { get { return VisualizationDataSpec.Columns; } } - - [JsonIgnore] - public List Rows { get { return VisualizationDataSpec.Rows; } } - - [JsonIgnore] - public List Values { get { return VisualizationDataSpec.Values; } } - - [JsonProperty(Order = 7)] - PivotVisualizationDataSpec VisualizationDataSpec { get; set; } = new PivotVisualizationDataSpec(); - } + /// The data soure item used to represent a dataset. + public PivotVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) + { + //this is a workaround because the json schemea has this property on the VisualizationDataSpec and not on the VisualizationSettings where it belongs + Settings._visualizationDataSpec = VisualizationDataSpec; + ChartType = ChartType.Pivot; + } + + [JsonIgnore] + public List Columns { get { return VisualizationDataSpec.Columns; } } + + [JsonIgnore] + public List Rows { get { return VisualizationDataSpec.Rows; } } + + [JsonIgnore] + public List Values { get { return VisualizationDataSpec.Values; } } + + [JsonProperty(Order = 7)] + PivotVisualizationDataSpec VisualizationDataSpec { get; set; } = new PivotVisualizationDataSpec(); + } } \ No newline at end of file diff --git a/src/Reveal.Sdk.Dom/Visualizations/RadialVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/RadialVisualization.cs index d5b6776c..f127978f 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/RadialVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/RadialVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The radial visualization is used for taking data and rendering it as a collection of data points wrapped around a circle. - /// - public sealed class RadialVisualization : CategoryVisualizationBase - { - internal RadialVisualization() : this(null) { } - + /// + public sealed class RadialVisualization : CategoryVisualizationBase + { + internal RadialVisualization() : this(null) { } + /// /// Creates a radial visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public RadialVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public RadialVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a radial visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public RadialVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public RadialVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Radial; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/ScatterMapVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/ScatterMapVisualization.cs index 8926820f..b6a8bb91 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/ScatterMapVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/ScatterMapVisualization.cs @@ -1,85 +1,85 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The scatter map visualization is used to display geo-spatial data using points or markers in a geographic context. This type of visualization is often used to render a collection of geographic locations such as cities, airports, earthquakes, or points of interests. - /// - public sealed class ScatterMapVisualization : TabularVisualizationBase, ILabel, IMap - { - internal ScatterMapVisualization() : this(null) { } - + /// + public sealed class ScatterMapVisualization : TabularVisualizationBase, ILabel, IMap + { + internal ScatterMapVisualization() : this(null) { } + /// /// Creates a scatter map visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public ScatterMapVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public ScatterMapVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a scatter map visualization from the supplied . /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public ScatterMapVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - internal ScatterMapVisualizationDataSpec VisualizationDataSpec { get; set; } = new ScatterMapVisualizationDataSpec(); - - [JsonIgnore] - public DimensionColumn Label - { - get { return VisualizationDataSpec.Label; } - set { VisualizationDataSpec.Label = value; } - } - - [JsonIgnore] - public string Map - { - get { return Settings.Region; } - set { Settings.Region = value; } - } - - [JsonIgnore] - public DimensionColumn Latitude - { - get { return VisualizationDataSpec.Location; } - set { VisualizationDataSpec.Location = value; } - } - - [JsonIgnore] - public DimensionColumn Longitude - { - get { return VisualizationDataSpec.Longitude; } - set { VisualizationDataSpec.Longitude = value; } - } - - [JsonIgnore] - public List MapColor - { - get { return VisualizationDataSpec.MapColor; } - set { VisualizationDataSpec.MapColor = value; } - } - - [JsonIgnore] - public DimensionColumn MapColorCategory - { - get { return VisualizationDataSpec.MapColorCategory; } - set - { - VisualizationDataSpec.IsColorByValue = false; - VisualizationDataSpec.MapColorCategory = value; - } - } - - [JsonIgnore] - public List BubbleRadius - { - get { return VisualizationDataSpec.Radius; } - set { VisualizationDataSpec.Radius = value; } - } - } -} + /// The data soure item used to represent a dataset. + public ScatterMapVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.ScatterMap; } + + [JsonProperty(Order = 7)] + internal ScatterMapVisualizationDataSpec VisualizationDataSpec { get; set; } = new ScatterMapVisualizationDataSpec(); + + [JsonIgnore] + public DimensionColumn Label + { + get { return VisualizationDataSpec.Label; } + set { VisualizationDataSpec.Label = value; } + } + + [JsonIgnore] + public string Map + { + get { return Settings.Region; } + set { Settings.Region = value; } + } + + [JsonIgnore] + public DimensionColumn Latitude + { + get { return VisualizationDataSpec.Location; } + set { VisualizationDataSpec.Location = value; } + } + + [JsonIgnore] + public DimensionColumn Longitude + { + get { return VisualizationDataSpec.Longitude; } + set { VisualizationDataSpec.Longitude = value; } + } + + [JsonIgnore] + public List MapColor + { + get { return VisualizationDataSpec.MapColor; } + set { VisualizationDataSpec.MapColor = value; } + } + + [JsonIgnore] + public DimensionColumn MapColorCategory + { + get { return VisualizationDataSpec.MapColorCategory; } + set + { + VisualizationDataSpec.IsColorByValue = false; + VisualizationDataSpec.MapColorCategory = value; + } + } + + [JsonIgnore] + public List BubbleRadius + { + get { return VisualizationDataSpec.Radius; } + set { VisualizationDataSpec.Radius = value; } + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/ScatterVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/ScatterVisualization.cs index 9a85dd10..af9ef2c3 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/ScatterVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/ScatterVisualization.cs @@ -1,41 +1,41 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The scatter visualization is used to show the relationship among items in distinct series of data or to plot data items using numeric x and y coordinates. These charts draw attention to uneven intervals or clusters of data. - /// - public sealed class ScatterVisualization : TabularVisualizationBase, ILabels, IAxis - { - internal ScatterVisualization() : this(null) { } - + /// + public sealed class ScatterVisualization : TabularVisualizationBase, ILabels, IAxis + { + internal ScatterVisualization() : this(null) { } + /// /// Creates a scatter visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public ScatterVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public ScatterVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a scatter visualization from the supplied . /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public ScatterVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - ScatterVisualizationDataSpec VisualizationDataSpec { get; set; } = new ScatterVisualizationDataSpec(); - - [JsonIgnore] - public List Labels { get { return VisualizationDataSpec.Rows; } } - - [JsonIgnore] - public List XAxes { get { return VisualizationDataSpec.XAxis; } } - - [JsonIgnore] - public List YAxes { get { return VisualizationDataSpec.YAxis; } } - } -} + /// The data soure item used to represent a dataset. + public ScatterVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Scatter; } + + [JsonProperty(Order = 7)] + ScatterVisualizationDataSpec VisualizationDataSpec { get; set; } = new ScatterVisualizationDataSpec(); + + [JsonIgnore] + public List Labels { get { return VisualizationDataSpec.Rows; } } + + [JsonIgnore] + public List XAxes { get { return VisualizationDataSpec.XAxis; } } + + [JsonIgnore] + public List YAxes { get { return VisualizationDataSpec.YAxis; } } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/AreaChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/AreaChartVisualizationSettings.cs index fcbc7cf0..832276e3 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/AreaChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/AreaChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class AreaChartVisualizationSettings : CategoryChartVisualizationSettings - { - public AreaChartVisualizationSettings() - { - ChartType = ChartType.Area; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class AreaChartVisualizationSettings : CategoryChartVisualizationSettings + { + public AreaChartVisualizationSettings() + { + ChartType = RdashChartType.Area; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/BarChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/BarChartVisualizationSettings.cs index ae203044..7b40b63d 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/BarChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/BarChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class BarChartVisualizationSettings : CategoryChartVisualizationSettings - { - public BarChartVisualizationSettings() - { - ChartType = ChartType.Bar; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class BarChartVisualizationSettings : CategoryChartVisualizationSettings + { + public BarChartVisualizationSettings() + { + ChartType = RdashChartType.Bar; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/BubbleVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/BubbleVisualizationSettings.cs index c4a41474..a50a9c51 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/BubbleVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/BubbleVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class BubbleVisualizationSettings : ScatterVisualizationSettings - { - public BubbleVisualizationSettings() - { - ChartType = ChartType.Bubble; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class BubbleVisualizationSettings : ScatterVisualizationSettings + { + public BubbleVisualizationSettings() + { + ChartType = RdashChartType.Bubble; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/CandleStickVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/CandleStickVisualizationSettings.cs index 1a6c1c74..1d2f0a4b 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/CandleStickVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/CandleStickVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class CandleStickVisualizationSettings : FinancialVisualizationSettingsBase - { - public CandleStickVisualizationSettings() - { - ChartType = ChartType.Candlestick; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class CandleStickVisualizationSettings : FinancialVisualizationSettingsBase + { + public CandleStickVisualizationSettings() + { + ChartType = RdashChartType.Candlestick; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/ChartVisualizationSettingsBase.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/ChartVisualizationSettingsBase.cs index 6f2f7d29..fdd644de 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/ChartVisualizationSettingsBase.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/ChartVisualizationSettingsBase.cs @@ -1,22 +1,22 @@ -using Reveal.Sdk.Dom.Core.Constants; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public abstract class ChartVisualizationSettingsBase : VisualizationSettings - { - protected ChartVisualizationSettingsBase() - { - SchemaTypeName = SchemaTypeNames.ChartVisualizationSettingsType; - VisualizationType = VisualizationTypes.CHART; - } - - /// - /// Gets or sets the chart type of the Visualization - /// - [JsonProperty] - [JsonConverter(typeof(StringEnumConverter))] - internal ChartType ChartType { get; set; } - } -} +using Reveal.Sdk.Dom.Core.Constants; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public abstract class ChartVisualizationSettingsBase : VisualizationSettings + { + protected ChartVisualizationSettingsBase() + { + SchemaTypeName = SchemaTypeNames.ChartVisualizationSettingsType; + VisualizationType = VisualizationTypes.CHART; + } + + /// + /// Gets or sets the chart type of the Visualization + /// + [JsonProperty] + [JsonConverter(typeof(StringEnumConverter))] + internal RdashChartType ChartType { get; set; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/ColumnChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/ColumnChartVisualizationSettings.cs index f60f1b67..95a1ccfb 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/ColumnChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/ColumnChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class ColumnChartVisualizationSettings : CategoryChartVisualizationSettings - { - public ColumnChartVisualizationSettings() - { - ChartType = ChartType.Column; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class ColumnChartVisualizationSettings : CategoryChartVisualizationSettings + { + public ColumnChartVisualizationSettings() + { + ChartType = RdashChartType.Column; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/ComboChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/ComboChartVisualizationSettings.cs index 8e228cef..6ef4beb2 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/ComboChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/ComboChartVisualizationSettings.cs @@ -1,67 +1,67 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class ComboChartVisualizationSettings : YAxisVisualizationSettings - { - public ComboChartVisualizationSettings() - { - ChartType = ChartType.Composite; - } - - /// - /// Gets or sets whether Chart2 is overlayed on top of Chart1 with an opacity applied to the chart on top. - /// - [JsonProperty("CompositeChartTypesSwapped")] - public bool Chart2OnTop { get; set; } - - /// - /// Gets or sets the chart type for Chart1 - /// - [JsonProperty("CompositeChartType1")] - [JsonConverter(typeof(StringEnumConverter))] - public ComboChartType Chart1Type { get; set; } = ComboChartType.Column; - - /// - /// Gets or sets the chart type for Chart2 - /// - [JsonProperty("CompositeChartType2")] - [JsonConverter(typeof(StringEnumConverter))] - public ComboChartType Chart2Type { get; set; } = ComboChartType.Line; - - /// - /// Gets or sets if the right axis will use the Logarithmic scale. Linear is used by default. - /// - [JsonProperty("RightAxisLogarithmic")] - public bool RightAxisIsLogarithmic { get; set; } - - /// - /// Gets or sets the minimum value for the right axis. Default value is 0. - /// - [JsonProperty] - public double? RightAxisMinValue { get; set; } - - /// - /// Gets or sets the maximum value for the right axis. Default value is calculated automatically depending on the values. - /// - [JsonProperty] - public double? RightAxisMaxValue { get; set; } - - /// - /// This property is being wrapped by the in order to match the UI experience. This property is needed for the reveal JSON schema. - /// - [JsonProperty] - internal bool SingleAxisMode { get; set; } - - /// - /// Gets or sets if the visualization will display the right axis. - /// - [JsonIgnore] - public bool ShowRightAxis - { - get { return !SingleAxisMode; } - set { SingleAxisMode = !value; } - } - } -} +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class ComboChartVisualizationSettings : YAxisVisualizationSettings + { + public ComboChartVisualizationSettings() + { + ChartType = RdashChartType.Composite; + } + + /// + /// Gets or sets whether Chart2 is overlayed on top of Chart1 with an opacity applied to the chart on top. + /// + [JsonProperty("CompositeChartTypesSwapped")] + public bool Chart2OnTop { get; set; } + + /// + /// Gets or sets the chart type for Chart1 + /// + [JsonProperty("CompositeChartType1")] + [JsonConverter(typeof(StringEnumConverter))] + public ComboChartType Chart1Type { get; set; } = ComboChartType.Column; + + /// + /// Gets or sets the chart type for Chart2 + /// + [JsonProperty("CompositeChartType2")] + [JsonConverter(typeof(StringEnumConverter))] + public ComboChartType Chart2Type { get; set; } = ComboChartType.Line; + + /// + /// Gets or sets if the right axis will use the Logarithmic scale. Linear is used by default. + /// + [JsonProperty("RightAxisLogarithmic")] + public bool RightAxisIsLogarithmic { get; set; } + + /// + /// Gets or sets the minimum value for the right axis. Default value is 0. + /// + [JsonProperty] + public double? RightAxisMinValue { get; set; } + + /// + /// Gets or sets the maximum value for the right axis. Default value is calculated automatically depending on the values. + /// + [JsonProperty] + public double? RightAxisMaxValue { get; set; } + + /// + /// This property is being wrapped by the in order to match the UI experience. This property is needed for the reveal JSON schema. + /// + [JsonProperty] + internal bool SingleAxisMode { get; set; } + + /// + /// Gets or sets if the visualization will display the right axis. + /// + [JsonIgnore] + public bool ShowRightAxis + { + get { return !SingleAxisMode; } + set { SingleAxisMode = !value; } + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/DoughnutChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/DoughnutChartVisualizationSettings.cs index 47ad3974..7aef2acf 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/DoughnutChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/DoughnutChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class DoughnutChartVisualizationSettings : RoundChartVisualizationSettingsBase - { - public DoughnutChartVisualizationSettings() - { - ChartType = ChartType.Doughnut; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class DoughnutChartVisualizationSettings : RoundChartVisualizationSettingsBase + { + public DoughnutChartVisualizationSettings() + { + ChartType = RdashChartType.Doughnut; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/FunnelChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/FunnelChartVisualizationSettings.cs index 6a9d7701..bb083e1a 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/FunnelChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/FunnelChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class FunnelChartVisualizationSettings : PieChartVisualizationSettingsBase - { - public FunnelChartVisualizationSettings() - { - ChartType = ChartType.Funnel; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class FunnelChartVisualizationSettings : PieChartVisualizationSettingsBase + { + public FunnelChartVisualizationSettings() + { + ChartType = RdashChartType.Funnel; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/LineChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/LineChartVisualizationSettings.cs index c0cfff71..f9774f1a 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/LineChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/LineChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class LineChartVisualizationSettings : CategoryChartVisualizationSettings - { - public LineChartVisualizationSettings() - { - ChartType = ChartType.Line; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class LineChartVisualizationSettings : CategoryChartVisualizationSettings + { + public LineChartVisualizationSettings() + { + ChartType = RdashChartType.Line; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/OHLCVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/OHLCVisualizationSettings.cs index e1c2351c..2aba670e 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/OHLCVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/OHLCVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class OHLCVisualizationSettings : FinancialVisualizationSettingsBase - { - public OHLCVisualizationSettings() - { - ChartType = ChartType.OHLC; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class OHLCVisualizationSettings : FinancialVisualizationSettingsBase + { + public OHLCVisualizationSettings() + { + ChartType = RdashChartType.OHLC; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/PieChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/PieChartVisualizationSettings.cs index 63a50024..c6490dab 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/PieChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/PieChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class PieChartVisualizationSettings : RoundChartVisualizationSettingsBase - { - public PieChartVisualizationSettings() - { - ChartType = ChartType.Pie; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class PieChartVisualizationSettings : RoundChartVisualizationSettingsBase + { + public PieChartVisualizationSettings() + { + ChartType = RdashChartType.Pie; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/RadialVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/RadialVisualizationSettings.cs index b5546afd..255a234e 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/RadialVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/RadialVisualizationSettings.cs @@ -1,20 +1,20 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class RadialVisualizationSettings : ChartVisualizationSettings - { - public RadialVisualizationSettings() - { - ChartType = ChartType.RadialLines; - } - - /// - /// Gets or sets a trendline to apply to the visualization - /// - [JsonProperty("TrendlineType")] - [JsonConverter(typeof(StringEnumConverter))] - public TrendlineType Trendline { get; set; } - } -} +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class RadialVisualizationSettings : ChartVisualizationSettings + { + public RadialVisualizationSettings() + { + ChartType = RdashChartType.RadialLines; + } + + /// + /// Gets or sets a trendline to apply to the visualization + /// + [JsonProperty("TrendlineType")] + [JsonConverter(typeof(StringEnumConverter))] + public TrendlineType Trendline { get; set; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs index ccba9ba0..4695854c 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs @@ -1,30 +1,30 @@ -using Newtonsoft.Json; - -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public class ScatterVisualizationSettings : YAxisVisualizationSettings - { - public ScatterVisualizationSettings() - { - ChartType = ChartType.Scatter; - } - - /// - /// Gets or sets if the X axis will use the Logarithmic scale. Linear is used by default. - /// - [JsonProperty("RightAxisLogarithmic")] - public bool XAxisIsLogarithmic { get; set; } - - /// - /// Gets or sets the minimum value for the X axis. Default value is 0. - /// - [JsonProperty("RightAxisMinValue")] - public double? XAxisMinValue { get; set; } - - /// - /// Gets or sets the maximum value for the X axis. Default value is calculated automatically depending on the values. - /// - [JsonProperty("RightAxisMaxValue")] - public double? XAxisMaxValue { get; set; } - } -} +using Newtonsoft.Json; + +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public class ScatterVisualizationSettings : YAxisVisualizationSettings + { + public ScatterVisualizationSettings() + { + ChartType = RdashChartType.Scatter; + } + + /// + /// Gets or sets if the X axis will use the Logarithmic scale. Linear is used by default. + /// + [JsonProperty("RightAxisLogarithmic")] + public bool XAxisIsLogarithmic { get; set; } + + /// + /// Gets or sets the minimum value for the X axis. Default value is 0. + /// + [JsonProperty("RightAxisMinValue")] + public double? XAxisMinValue { get; set; } + + /// + /// Gets or sets the maximum value for the X axis. Default value is calculated automatically depending on the values. + /// + [JsonProperty("RightAxisMaxValue")] + public double? XAxisMaxValue { get; set; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/SharedChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/SharedChartVisualizationSettings.cs index fc5efa69..35f1240a 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/SharedChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/SharedChartVisualizationSettings.cs @@ -1,61 +1,61 @@ -using Newtonsoft.Json; - -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - /// - /// This class provides properties that are used by the Column, Bar, Stack Column, Stacked Bar, Stacked Area, Area, Line, Step Area, Step Line, Spline Area, Spline, and Time Series charts. - /// - public abstract class SharedChartVisualizationSettings : YAxisVisualizationSettings - { - protected SharedChartVisualizationSettings() : base() { } - - /// - /// Gets or sets a value that determines if the chart will automatcially rotate labels - /// - public bool AutomaticLabelRotation { get; set; } - - /// - /// Gets or sets a values that will sync the axis to the visible range. - /// - [JsonProperty("SyncAxisVisibleRange")] - public bool SyncAxis { get; set; } - - /// - /// Gets or sets a value that represents the zoom level of the chart. Zoom level ranges from 0.0 (0% zoom) to 1.0 (100% zoom). - /// - [JsonIgnore] - public double ZoomLevel - { - get - { - if (ChartType == ChartType.Bar || ChartType == ChartType.StackedBar) - return ZoomScaleVertical; - - return ZoomScaleHorizontal; - } - set - { - if (ChartType == ChartType.Bar || ChartType == ChartType.StackedBar) - ZoomScaleVertical = CoerceValue(value); - else - ZoomScaleHorizontal = CoerceValue(value); - } - } - - [JsonProperty] - internal double ZoomScaleHorizontal { get; set; } = 1; - - [JsonProperty] - internal double ZoomScaleVertical { get; set; } = 1; - - double CoerceValue(double value) - { - if (value > 1) - return 1; - else if (value < 0) - return 0; - else - return value; - } - } -} +using Newtonsoft.Json; + +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + /// + /// This class provides properties that are used by the Column, Bar, Stack Column, Stacked Bar, Stacked Area, Area, Line, Step Area, Step Line, Spline Area, Spline, and Time Series charts. + /// + public abstract class SharedChartVisualizationSettings : YAxisVisualizationSettings + { + protected SharedChartVisualizationSettings() : base() { } + + /// + /// Gets or sets a value that determines if the chart will automatcially rotate labels + /// + public bool AutomaticLabelRotation { get; set; } + + /// + /// Gets or sets a values that will sync the axis to the visible range. + /// + [JsonProperty("SyncAxisVisibleRange")] + public bool SyncAxis { get; set; } + + /// + /// Gets or sets a value that represents the zoom level of the chart. Zoom level ranges from 0.0 (0% zoom) to 1.0 (100% zoom). + /// + [JsonIgnore] + public double ZoomLevel + { + get + { + if (ChartType == RdashChartType.Bar || ChartType == RdashChartType.StackedBar) + return ZoomScaleVertical; + + return ZoomScaleHorizontal; + } + set + { + if (ChartType == RdashChartType.Bar || ChartType == RdashChartType.StackedBar) + ZoomScaleVertical = CoerceValue(value); + else + ZoomScaleHorizontal = CoerceValue(value); + } + } + + [JsonProperty] + internal double ZoomScaleHorizontal { get; set; } = 1; + + [JsonProperty] + internal double ZoomScaleVertical { get; set; } = 1; + + double CoerceValue(double value) + { + if (value > 1) + return 1; + else if (value < 0) + return 0; + else + return value; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineAreaChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineAreaChartVisualizationSettings.cs index 335f15cf..d9c9f642 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineAreaChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineAreaChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class SplineAreaChartVisualizationSettings : CategoryChartVisualizationSettings - { - public SplineAreaChartVisualizationSettings() - { - ChartType = ChartType.SplineArea; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class SplineAreaChartVisualizationSettings : CategoryChartVisualizationSettings + { + public SplineAreaChartVisualizationSettings() + { + ChartType = RdashChartType.SplineArea; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineChartVisualizationSettings.cs index 86531514..148ac81d 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/SplineChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class SplineChartVisualizationSettings : CategoryChartVisualizationSettings - { - public SplineChartVisualizationSettings() - { - ChartType = ChartType.Spline; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class SplineChartVisualizationSettings : CategoryChartVisualizationSettings + { + public SplineChartVisualizationSettings() + { + ChartType = RdashChartType.Spline; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedAreaChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedAreaChartVisualizationSettings.cs index f9f6b5af..cc5e2558 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedAreaChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedAreaChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class StackedAreaChartVisualizationSettings : StackedVisualizationSettingsBase - { - public StackedAreaChartVisualizationSettings() - { - ChartType = ChartType.StackedArea; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class StackedAreaChartVisualizationSettings : StackedVisualizationSettingsBase + { + public StackedAreaChartVisualizationSettings() + { + ChartType = RdashChartType.StackedArea; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedBarChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedBarChartVisualizationSettings.cs index 81a46cb8..ce0bdfb0 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedBarChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedBarChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class StackedBarChartVisualizationSettings : StackedVisualizationSettingsBase - { - public StackedBarChartVisualizationSettings() - { - ChartType = ChartType.StackedBar; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class StackedBarChartVisualizationSettings : StackedVisualizationSettingsBase + { + public StackedBarChartVisualizationSettings() + { + ChartType = RdashChartType.StackedBar; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedColumnChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedColumnChartVisualizationSettings.cs index 99155562..83b52529 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedColumnChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/StackedColumnChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class StackedColumnChartVisualizationSettings : StackedVisualizationSettingsBase - { - public StackedColumnChartVisualizationSettings() - { - ChartType = ChartType.StackedColumn; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class StackedColumnChartVisualizationSettings : StackedVisualizationSettingsBase + { + public StackedColumnChartVisualizationSettings() + { + ChartType = RdashChartType.StackedColumn; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/StepAreaChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/StepAreaChartVisualizationSettings.cs index beaf96fc..7fba4f5a 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/StepAreaChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/StepAreaChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class StepAreaChartVisualizationSettings : CategoryChartVisualizationSettings - { - public StepAreaChartVisualizationSettings() - { - ChartType = ChartType.StepArea; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class StepAreaChartVisualizationSettings : CategoryChartVisualizationSettings + { + public StepAreaChartVisualizationSettings() + { + ChartType = RdashChartType.StepArea; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/StepLineChartVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/StepLineChartVisualizationSettings.cs index 26f5e2f0..e4036223 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/StepLineChartVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/StepLineChartVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class StepLineChartVisualizationSettings : CategoryChartVisualizationSettings - { - public StepLineChartVisualizationSettings() - { - ChartType = ChartType.StepLine; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class StepLineChartVisualizationSettings : CategoryChartVisualizationSettings + { + public StepLineChartVisualizationSettings() + { + ChartType = RdashChartType.StepLine; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/TimeSeriesVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/TimeSeriesVisualizationSettings.cs index 85d945e9..6d579b4f 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/TimeSeriesVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/TimeSeriesVisualizationSettings.cs @@ -1,10 +1,10 @@ -namespace Reveal.Sdk.Dom.Visualizations.Settings -{ - public sealed class TimeSeriesVisualizationSettings : CategoryChartVisualizationSettings - { - public TimeSeriesVisualizationSettings() - { - ChartType = ChartType.TimeSeries; - } - } -} +namespace Reveal.Sdk.Dom.Visualizations.Settings +{ + public sealed class TimeSeriesVisualizationSettings : CategoryChartVisualizationSettings + { + public TimeSeriesVisualizationSettings() + { + ChartType = RdashChartType.TimeSeries; + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/SparklineVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/SparklineVisualization.cs index c8c7550a..eab02264 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/SparklineVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/SparklineVisualization.cs @@ -1,54 +1,55 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The sparkline visualization is used to show data in table form along with a small-scale chart that uses a line or area series to show trends in a collection of values. - /// - public sealed class SparklineVisualization : TabularVisualizationBase, IDate, IValues, ICategories - { - internal SparklineVisualization() : this(null) { } - + /// + public sealed class SparklineVisualization : TabularVisualizationBase, IDate, IValues, ICategories + { + internal SparklineVisualization() : this(null) { } + /// /// Creates a sparkline visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public SparklineVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public SparklineVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a sparkline visualization from the supplied . /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public SparklineVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) - { - Settings._visualizationDataSpec = VisualizationDataSpec; - } - - [JsonIgnore] - public DimensionColumn Date - { - get { return VisualizationDataSpec.Date; } - set { VisualizationDataSpec.Date = value; } - } - - [JsonIgnore] - public List Values - { - get { return VisualizationDataSpec.Value; } - } - - [JsonIgnore] - public List Categories - { - get { return VisualizationDataSpec.Rows; } - } - - [JsonProperty(Order = 7)] - SparklineVisualizationDataSpec VisualizationDataSpec { get; set; } = new SparklineVisualizationDataSpec(); - } + /// The data soure item used to represent a dataset. + public SparklineVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) + { + Settings._visualizationDataSpec = VisualizationDataSpec; + ChartType = ChartType.Sparkline; + } + + [JsonIgnore] + public DimensionColumn Date + { + get { return VisualizationDataSpec.Date; } + set { VisualizationDataSpec.Date = value; } + } + + [JsonIgnore] + public List Values + { + get { return VisualizationDataSpec.Value; } + } + + [JsonIgnore] + public List Categories + { + get { return VisualizationDataSpec.Rows; } + } + + [JsonProperty(Order = 7)] + SparklineVisualizationDataSpec VisualizationDataSpec { get; set; } = new SparklineVisualizationDataSpec(); + } } \ No newline at end of file diff --git a/src/Reveal.Sdk.Dom/Visualizations/SplineAreaChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/SplineAreaChartVisualization.cs index d9df1625..a0d2898d 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/SplineAreaChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/SplineAreaChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The spline area visualization is used for rendering a collection of points connected by smooth curves with the area below the line filled in. Values are represented on the y-axis and categories are displayed on the x-axis. - /// - public sealed class SplineAreaChartVisualization : CategoryVisualizationBase - { - internal SplineAreaChartVisualization() : this(null) { } - + /// + public sealed class SplineAreaChartVisualization : CategoryVisualizationBase + { + internal SplineAreaChartVisualization() : this(null) { } + /// /// Creates a spline area visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public SplineAreaChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public SplineAreaChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a spline area visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public SplineAreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public SplineAreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.SplineArea; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/SplineChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/SplineChartVisualization.cs index 3172a98e..86864da1 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/SplineChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/SplineChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The spline visualization is used for rendering a collection of points connected by smooth curves. Values are represented on the y-axis and categories are displayed on the x-axis. - /// - public sealed class SplineChartVisualization : CategoryVisualizationBase - { - internal SplineChartVisualization() : this(null) { } - + /// + public sealed class SplineChartVisualization : CategoryVisualizationBase + { + internal SplineChartVisualization() : this(null) { } + /// /// Creates a spline visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public SplineChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public SplineChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a spline visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public SplineChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public SplineChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Spline; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/StackedAreaChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/StackedAreaChartVisualization.cs index 308b1a43..a91f4cba 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/StackedAreaChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/StackedAreaChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The stacked area visualization is used for showing plotted data as filled areas stacked, one on top of the other. A stacked area visualization can show how part to whole relationships change over time. - /// - public sealed class StackedAreaChartVisualization : CategoryVisualizationBase - { - internal StackedAreaChartVisualization() : this(null) { } - + /// + public sealed class StackedAreaChartVisualization : CategoryVisualizationBase + { + internal StackedAreaChartVisualization() : this(null) { } + /// /// Creates a stacked area visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public StackedAreaChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public StackedAreaChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a stacked area visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public StackedAreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public StackedAreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.StackedArea; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/StackedBarChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/StackedBarChartVisualization.cs index f48079ec..c67c3b9b 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/StackedBarChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/StackedBarChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The stacked bar visualization is used to break down and compare parts of a whole, where the bars represent parts of a whole. The segments in the bar illustrate different categories and colors are used to differentiate between them. - /// - public sealed class StackedBarChartVisualization : CategoryVisualizationBase - { - internal StackedBarChartVisualization() : this(null) { } - + /// + public sealed class StackedBarChartVisualization : CategoryVisualizationBase + { + internal StackedBarChartVisualization() : this(null) { } + /// /// Creates a stacked bar visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public StackedBarChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public StackedBarChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a stacked bar visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public StackedBarChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public StackedBarChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.StackedBar; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/StackedColumnChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/StackedColumnChartVisualization.cs index cdef650a..50b5e315 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/StackedColumnChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/StackedColumnChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The stacked column visualization is used to break down and compare parts of a whole, where the column represent parts of a whole. The segments in the column illustrate different categories and colors are used to differentiate between them. - /// - public sealed class StackedColumnChartVisualization : CategoryVisualizationBase - { - internal StackedColumnChartVisualization() : this(null) { } - + /// + public sealed class StackedColumnChartVisualization : CategoryVisualizationBase + { + internal StackedColumnChartVisualization() : this(null) { } + /// /// Creates a stacked column visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public StackedColumnChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public StackedColumnChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a stacked column visualization from the supplied and sets the title to the provided string. /// /// The data soure item used to represent a dataset. - /// The data soure item used to represent a dataset. - public StackedColumnChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public StackedColumnChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.StackedColumn; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/StepAreaChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/StepAreaChartVisualization.cs index b59dff65..e92b451f 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/StepAreaChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/StepAreaChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The step area visualization is used for rendering a collection of points connected by continuous vertical and horizontal lines with the area below the line filled in. - /// - public sealed class StepAreaChartVisualization : CategoryVisualizationBase - { - internal StepAreaChartVisualization() : this(null) { } - + /// + public sealed class StepAreaChartVisualization : CategoryVisualizationBase + { + internal StepAreaChartVisualization() : this(null) { } + /// /// Creates a step area visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public StepAreaChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public StepAreaChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a step area visualization from the supplied and sets the title to the provided string. /// /// The data soure item used to represent a dataset. - /// The data soure item used to represent a dataset. - public StepAreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public StepAreaChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.StepArea; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/StepLineChartVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/StepLineChartVisualization.cs index 78570531..bb939942 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/StepLineChartVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/StepLineChartVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations { /// /// The step line visualization is used for rendering a collection of points connected by continuous vertical and horizontal lines. - /// - public sealed class StepLineChartVisualization : CategoryVisualizationBase - { - internal StepLineChartVisualization() : this(null) { } - + /// + public sealed class StepLineChartVisualization : CategoryVisualizationBase + { + internal StepLineChartVisualization() : this(null) { } + /// /// Creates a step line visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public StepLineChartVisualization(DataSourceItem dataSourceItem) : base(dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public StepLineChartVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a step line visualization from the supplied and sets the title to the provided string. /// /// The data soure item used to represent a dataset. - /// The data soure item used to represent a dataset. - public StepLineChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public StepLineChartVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.StepLine; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/TextBoxVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/TextBoxVisualization.cs index 80acd056..9620475f 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/TextBoxVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/TextBoxVisualization.cs @@ -21,6 +21,7 @@ public TextBoxVisualization(string title) : base(title) { DataDefinition = new TextBoxDataDefinition(); DataDefinition.Bindings = null; + ChartType = ChartType.TextBox; } [JsonIgnore] diff --git a/src/Reveal.Sdk.Dom/Visualizations/TextViewVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/TextViewVisualization.cs index 11ff5ff7..a799dcd1 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/TextViewVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/TextViewVisualization.cs @@ -1,35 +1,35 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The text view visualization is used to display information that follows a key-value pattern. It only displays the first row of data paired with the column's label. - /// - public sealed class TextViewVisualization : TabularVisualizationBase, ITabularColumns - { - internal TextViewVisualization() : this(null) { } - + /// + public sealed class TextViewVisualization : TabularVisualizationBase, ITabularColumns + { + internal TextViewVisualization() : this(null) { } + /// /// Creates a text view visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public TextViewVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public TextViewVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a text view visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public TextViewVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - GridVisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec(); - - [JsonIgnore] - public List Columns { get { return VisualizationDataSpec.Columns; } } - } -} + /// The data soure item used to represent a dataset. + public TextViewVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.TextView; } + + [JsonProperty(Order = 7)] + GridVisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec(); + + [JsonIgnore] + public List Columns { get { return VisualizationDataSpec.Columns; } } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/TextVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/TextVisualization.cs index 67b02dee..6f115fda 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/TextVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/TextVisualization.cs @@ -1,26 +1,26 @@ -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The text visualization is used for displaying a single value field's aggregation, such as average, count, sum, etc. - /// - public sealed class TextVisualization : SingleGaugeVisualizationBase - { - internal TextVisualization() : this(null) { } - + /// + public sealed class TextVisualization : SingleGaugeVisualizationBase + { + internal TextVisualization() : this(null) { } + /// /// Creates a text visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public TextVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public TextVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a text visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public TextVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - } -} + /// The data soure item used to represent a dataset. + public TextVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Text; } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/TimeSeriesVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/TimeSeriesVisualization.cs index 894f5aa7..b27784c1 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/TimeSeriesVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/TimeSeriesVisualization.cs @@ -1,59 +1,59 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// A time series visualization is used to display data points indexed in time order. It is commonly used to detect trends at a glance, allowing an easy observation of development over time. - /// - public sealed class TimeSeriesVisualization : TabularVisualizationBase, IDate, IValues, ICategory - { - internal TimeSeriesVisualization() : this(null) { } - + /// + public sealed class TimeSeriesVisualization : TabularVisualizationBase, IDate, IValues, ICategory + { + internal TimeSeriesVisualization() : this(null) { } + /// /// Creates a time series visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public TimeSeriesVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public TimeSeriesVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a time series visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public TimeSeriesVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - TimeSeriesVisualizationDataSpec VisualizationDataSpec { get; set; } = new TimeSeriesVisualizationDataSpec(); - - [JsonIgnore] - public List Values { get { return VisualizationDataSpec.Values; } } - - [JsonIgnore] - public DimensionColumn Category - { - get { return VisualizationDataSpec.Category; } - set { VisualizationDataSpec.Category = value; } - } - - [JsonIgnore] - public DimensionColumn Date - { - get - { - if (VisualizationDataSpec.Rows.Count > 0) - return VisualizationDataSpec.Rows[0]; - else - return null; - } - set - { - VisualizationDataSpec.Rows.Clear(); - VisualizationDataSpec.Rows.Add(value); - } - } - } -} + /// The data soure item used to represent a dataset. + public TimeSeriesVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.TimeSeries; } + + [JsonProperty(Order = 7)] + TimeSeriesVisualizationDataSpec VisualizationDataSpec { get; set; } = new TimeSeriesVisualizationDataSpec(); + + [JsonIgnore] + public List Values { get { return VisualizationDataSpec.Values; } } + + [JsonIgnore] + public DimensionColumn Category + { + get { return VisualizationDataSpec.Category; } + set { VisualizationDataSpec.Category = value; } + } + + [JsonIgnore] + public DimensionColumn Date + { + get + { + if (VisualizationDataSpec.Rows.Count > 0) + return VisualizationDataSpec.Rows[0]; + else + return null; + } + set + { + VisualizationDataSpec.Rows.Clear(); + VisualizationDataSpec.Rows.Add(value); + } + } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/TreeMapVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/TreeMapVisualization.cs index 958c60b5..d7075a70 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/TreeMapVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/TreeMapVisualization.cs @@ -1,38 +1,38 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Data; -using Reveal.Sdk.Dom.Visualizations.Settings; -using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Visualizations.Settings; +using Reveal.Sdk.Dom.Visualizations.VisualizationSpecs; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ /// /// The treemap visualization is used to display hierarchical data as a set of nested rectangles. Rectangles of each level are of different sizes and colors. - /// - public sealed class TreeMapVisualization : TabularVisualizationBase, ILabels, IValues - { - internal TreeMapVisualization() : this(null) { } - + /// + public sealed class TreeMapVisualization : TabularVisualizationBase, ILabels, IValues + { + internal TreeMapVisualization() : this(null) { } + /// /// Creates a treemap visualization from the supplied . /// - /// The data soure item used to represent a dataset. - public TreeMapVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } - + /// The data soure item used to represent a dataset. + public TreeMapVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceItem) { } + /// /// Creates a treemap visualization from the supplied and sets the title to the provided string. /// /// The string to use as the visualization's title. - /// The data soure item used to represent a dataset. - public TreeMapVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { } - - [JsonProperty(Order = 7)] - TreeMapVisualizationDataSpec VisualizationDataSpec { get; set; } = new TreeMapVisualizationDataSpec(); - - [JsonIgnore] - public List Labels { get { return VisualizationDataSpec.Rows; } } - - [JsonIgnore] - public List Values { get { return VisualizationDataSpec.Value; } } - } -} + /// The data soure item used to represent a dataset. + public TreeMapVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.TreeMap; } + + [JsonProperty(Order = 7)] + TreeMapVisualizationDataSpec VisualizationDataSpec { get; set; } = new TreeMapVisualizationDataSpec(); + + [JsonIgnore] + public List Labels { get { return VisualizationDataSpec.Rows; } } + + [JsonIgnore] + public List Values { get { return VisualizationDataSpec.Value; } } + } +} diff --git a/src/Reveal.Sdk.Dom/Visualizations/Visualization.cs b/src/Reveal.Sdk.Dom/Visualizations/Visualization.cs index 97584f04..98e12d65 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Visualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Visualization.cs @@ -1,57 +1,60 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Core; -using Reveal.Sdk.Dom.Filters; -using Reveal.Sdk.Dom.Visualizations.Settings; -using System; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Visualizations -{ - public abstract class Visualization : Visualization, ISettingsProvider, IDataDefinitionProvider, IFilterBindings - where TSettings : VisualizationSettings, new() - where TDataDefinition : DataDefinitionBase - { - protected Visualization(string title) : base(title) { } - - [JsonProperty("DataSpec", Order = 6)] - public TDataDefinition DataDefinition { get; internal set; } - - [JsonIgnore] - public List FilterBindings - { - get { return DataDefinition.Bindings.Bindings; } - } - - [JsonProperty("ActionsModel", Order = 10)] - public VisualizationLinker Linker { get; set; } - - [JsonProperty("VisualizationSettings", Order = 5)] - public TSettings Settings { get; internal set; } = new TSettings(); - } - - public abstract class Visualization : IVisualization, IParentDocument - { - protected Visualization(string title) - { - Title = title; - } - - [JsonProperty(Order = 0)] - public string Id { get; set; } = Guid.NewGuid().ToString(); - - [JsonProperty(Order = 1)] - public string Title { get; set; } - - [JsonProperty(Order = 2)] - public bool IsTitleVisible { get; set; } = true; - - [JsonProperty(Order = 3)] - public int ColumnSpan { get; set; } - - [JsonProperty(Order = 4)] - public int RowSpan { get; set; } - - [JsonIgnore] - RdashDocument IParentDocument.Document { get; set; } - } +using Newtonsoft.Json; +using Reveal.Sdk.Dom.Core; +using Reveal.Sdk.Dom.Filters; +using Reveal.Sdk.Dom.Visualizations.Settings; +using System; +using System.Collections.Generic; + +namespace Reveal.Sdk.Dom.Visualizations +{ + public abstract class Visualization : Visualization, ISettingsProvider, IDataDefinitionProvider, IFilterBindings + where TSettings : VisualizationSettings, new() + where TDataDefinition : DataDefinitionBase + { + protected Visualization(string title) : base(title) { } + + [JsonProperty("DataSpec", Order = 6)] + public TDataDefinition DataDefinition { get; internal set; } + + [JsonIgnore] + public List FilterBindings + { + get { return DataDefinition.Bindings.Bindings; } + } + + [JsonProperty("ActionsModel", Order = 10)] + public VisualizationLinker Linker { get; set; } + + [JsonProperty("VisualizationSettings", Order = 5)] + public TSettings Settings { get; internal set; } = new TSettings(); + } + + public abstract class Visualization : IVisualization, IParentDocument + { + protected Visualization(string title) + { + Title = title; + } + + [JsonProperty(Order = 0)] + public string Id { get; set; } = Guid.NewGuid().ToString(); + + [JsonIgnore] + public ChartType ChartType { get; protected set; } = ChartType.Unknown; + + [JsonProperty(Order = 1)] + public string Title { get; set; } + + [JsonProperty(Order = 2)] + public bool IsTitleVisible { get; set; } = true; + + [JsonProperty(Order = 3)] + public int ColumnSpan { get; set; } + + [JsonProperty(Order = 4)] + public int RowSpan { get; set; } + + [JsonIgnore] + RdashDocument IParentDocument.Document { get; set; } + } } \ No newline at end of file