From e94d75ee66227d193d6d98fbc049356addc24c77 Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 20 Jan 2025 11:21:58 +0700 Subject: [PATCH 1/4] Create scatter visualization sandbox --- .../ScatterVisualizationDashboard.cs | 92 +++++++++++++++++++ e2e/Sandbox/MainWindow.xaml.cs | 1 + 2 files changed, 93 insertions(+) create mode 100644 e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs diff --git a/e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs b/e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs new file mode 100644 index 00000000..fbdfee89 --- /dev/null +++ b/e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs @@ -0,0 +1,92 @@ +using Reveal.Sdk.Dom; +using Reveal.Sdk.Dom.Filters; +using Reveal.Sdk.Dom.Visualizations; +using Sandbox.Helpers; +using System; +using System.Collections.Generic; + +namespace Sandbox.DashboardFactories +{ + internal class ScatterVisualizationDashboard : IDashboardCreator + { + public string Name => "Scatter Visualization dashboard"; + + public RdashDocument CreateDashboard() + { + var document = new RdashDocument("Scatter Visualization Dashboard"); + + var excelDSItem = DataSourceFactory.GetMarketingDataSourceItem(); + + var scatterVS = new ScatterVisualization("Scatter Visualization", excelDSItem) + { + ColumnSpan = 3, + RowSpan = 4, + Description = "Testing Scatter visualization", + IsTitleVisible = true, + Linker = new VisualizationLinker() + { + Links = new List() + { + new DashboardLink() + { + Type = LinkType.OpenDashboard, + Title = "OpenUr", + Dashboard = "http" + } + }, + Trigger = LinkTriggerType.Maximize + }, + Id = "ScatterVS", + Title = "Excel Scatter Visualization", + }; + + scatterVS.ConfigureSettings((settings) => + { + settings.ShowLegend = true; + settings.StartColorIndex = 2; + settings.XAxisIsLogarithmic = true; + settings.XAxisMaxValue = 100000; + settings.XAxisMinValue = 100; + settings.YAxisIsLogarithmic = true; + settings.YAxisMaxValue = 750000; + settings.YAxisMinValue = 100; + }); + + // Data Specs + scatterVS + .SetLabel("CampaignID") + .SetXAxes("Spend") + .SetYAxes("Budget"); + + // Filters + var spendFilter = new DashboardDataFilter(excelDSItem) + { + Title = "Spend Filter", + FieldName = "Spend", + AllowMultipleSelection = true, + AllowEmptySelection = true + }; + var dateFilter = new DashboardDateFilter() + { + CustomDateRange = new DateRange() + { + From = DateTime.Today.AddDays(-15), + To = DateTime.Today.AddDays(-2) + }, + RuleType = DateRuleType.CustomRange, + Title = "Custom range date filter" + }; + + document.Filters.Add(spendFilter); + document.Filters.Add(dateFilter); + scatterVS.ConnectDashboardFilter(spendFilter).ConnectDashboardFilter(dateFilter); + + // Add quick filter + scatterVS.AddFilters("CTR"); + + document.Visualizations.Add(scatterVS); + + return document; + } + } +} diff --git a/e2e/Sandbox/MainWindow.xaml.cs b/e2e/Sandbox/MainWindow.xaml.cs index 7e74545a..952621e8 100644 --- a/e2e/Sandbox/MainWindow.xaml.cs +++ b/e2e/Sandbox/MainWindow.xaml.cs @@ -64,6 +64,7 @@ public partial class MainWindow : Window new RestDataSourceDashboard(), new SalesDashboard(), new ScatterMapVisualizationDashboard(), + new ScatterVisualizationDashboard(), new SnowflakeDashboard(), new SparklineVisualizationDashboard(), new SplineAreaChartVisualizationDashboard(), From 99549651779e744a890bd61fb4c65dd476d7b661 Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 20 Jan 2025 11:48:34 +0700 Subject: [PATCH 2/4] Add AxisDisplayMode field to scatter visualization --- .../ScatterVisualizationDashboard.cs | 1 + .../Settings/ScatterVisualizationSettings.cs | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs b/e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs index fbdfee89..f670ebb9 100644 --- a/e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs +++ b/e2e/Sandbox/DashboardCreators/Visualizations/ScatterVisualizationDashboard.cs @@ -50,6 +50,7 @@ public RdashDocument CreateDashboard() settings.YAxisIsLogarithmic = true; settings.YAxisMaxValue = 750000; settings.YAxisMinValue = 100; + settings.AxisDisplayMode = AxisDisplayMode.None; }); // Data Specs diff --git a/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs b/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs index 4695854c..85c95c7a 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/Settings/ScatterVisualizationSettings.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using System; namespace Reveal.Sdk.Dom.Visualizations.Settings { @@ -26,5 +27,59 @@ public ScatterVisualizationSettings() /// [JsonProperty("RightAxisMaxValue")] public double? XAxisMaxValue { get; set; } + + /// + /// Gets or sets if the visualization will display the X axis. + /// This property is being wrapped by the to simplify the API. + /// + [JsonProperty] + internal bool ShowAxisX { get; set; } = true; + + /// + /// Gets or sets if the visualization will display the Y axis. + /// This property is being wrapped by the to simplify the API. + /// + [JsonProperty] + internal bool ShowAxisY { get; set; } = true; + + /// + /// Gets or sets the display mode for the axis. + /// + [JsonIgnore] + public AxisDisplayMode AxisDisplayMode + { + get + { + if (ShowAxisX && ShowAxisY) return AxisDisplayMode.Both; + if (!ShowAxisX && !ShowAxisY) return AxisDisplayMode.None; + if (ShowAxisX) return AxisDisplayMode.XAxis; + if (ShowAxisY) return AxisDisplayMode.YAxis; + throw new InvalidOperationException("Invalid axis visibility state."); + } + set + { + switch (value) + { + case AxisDisplayMode.Both: + ShowAxisX = true; + ShowAxisY = true; + break; + case AxisDisplayMode.None: + ShowAxisX = false; + ShowAxisY = false; + break; + case AxisDisplayMode.XAxis: + ShowAxisX = true; + ShowAxisY = false; + break; + case AxisDisplayMode.YAxis: + ShowAxisX = false; + ShowAxisY = true; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + } } } From a448ac46ff105d57c773486bf51d3d85dcf6d7b2 Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 20 Jan 2025 14:34:43 +0700 Subject: [PATCH 3/4] Update failed unit tests --- .../BubbleVisualizationSettingsFixture.cs | 33 +++++++++++++++---- .../ScatterVisualizationSettingsFixture.cs | 30 ++++++++++++----- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/BubbleVisualizationSettingsFixture.cs b/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/BubbleVisualizationSettingsFixture.cs index 07a3e679..95912309 100644 --- a/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/BubbleVisualizationSettingsFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/BubbleVisualizationSettingsFixture.cs @@ -26,16 +26,35 @@ public void ToJsonString_GeneratesCorrectJson_WhenSerialized() var expectedJson = """ { - "_type" : "ChartVisualizationSettingsType", - "RightAxisLogarithmic" : false, - "LeftAxisLogarithmic" : false, - "ShowLegends" : true, - "ChartType" : "Bubble", - "VisualizationType" : "CHART" + "_type": "Test Bubble VS", + "RightAxisLogarithmic": true, + "RightAxisMinValue": 15.1, + "RightAxisMaxValue": 250.5, + "ShowAxisX": true, + "ShowAxisY": false, + "LeftAxisLogarithmic": true, + "LeftAxisMinValue": 16.2, + "LeftAxisMaxValue": 150.6, + "ShowLegends": true, + "BrushOffsetIndex": 3, + "ChartType": "Bubble", + "VisualizationType": "CHART" } """; - var settings = new BubbleVisualizationSettings(); + var settings = new BubbleVisualizationSettings() { + AxisDisplayMode = AxisDisplayMode.XAxis, + ChartType = RdashChartType.Bubble, + SchemaTypeName = "Test Bubble VS", + ShowLegend = true, + StartColorIndex = 3, + XAxisIsLogarithmic = true, + XAxisMinValue = 15.1, + XAxisMaxValue = 250.5, + YAxisMinValue = 16.2, + YAxisMaxValue = 150.6, + YAxisIsLogarithmic = true, + }; // Act var actualJson = settings.ToJsonString(); diff --git a/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/ScatterVisualizationSettingsFixture.cs b/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/ScatterVisualizationSettingsFixture.cs index e69cb80b..65df0b0d 100644 --- a/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/ScatterVisualizationSettingsFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Visualizations/Settings/ScatterVisualizationSettingsFixture.cs @@ -29,14 +29,19 @@ public void ToJsonString_GeneratesCorrectJson_WhenSerialized() var expectedJson = """ { - "_type" : "ChartVisualizationSettingsType", - "RightAxisLogarithmic" : true, - "RightAxisMinValue" : 1.0, - "LeftAxisLogarithmic" : false, - "LeftAxisMaxValue" : 90.0, - "ShowLegends" : true, - "ChartType" : "Scatter", - "VisualizationType" : "CHART" + "_type": "Testing Schema Type Name", + "RightAxisLogarithmic": true, + "RightAxisMinValue": 1.0, + "RightAxisMaxValue": 200.0, + "ShowAxisX": false, + "ShowAxisY": true, + "LeftAxisLogarithmic": true, + "LeftAxisMinValue": 100.0, + "LeftAxisMaxValue": 9000.0, + "ShowLegends": true, + "BrushOffsetIndex": 1, + "ChartType": "Scatter", + "VisualizationType": "CHART" } """; @@ -44,7 +49,14 @@ public void ToJsonString_GeneratesCorrectJson_WhenSerialized() { XAxisIsLogarithmic = true, XAxisMinValue = 1, - YAxisMaxValue = 90, + XAxisMaxValue = 200, + YAxisMinValue = 100, + YAxisMaxValue = 9000, + AxisDisplayMode = AxisDisplayMode.YAxis, + ShowLegend = true, + YAxisIsLogarithmic = true, + StartColorIndex = 1, + SchemaTypeName = "Testing Schema Type Name", }; // Act From 9eccfe61fe8c35987a681f72a70bac00a9789859 Mon Sep 17 00:00:00 2001 From: Viktor Date: Fri, 7 Feb 2025 11:05:15 +0700 Subject: [PATCH 4/4] Fix failed testcases --- .../BubbleVisualizationFixture.cs | 289 +++++++++--------- .../ScatterVisualizationFixture.cs | 240 ++++++++------- 2 files changed, 280 insertions(+), 249 deletions(-) diff --git a/src/Reveal.Sdk.Dom.Tests/Visualizations/BubbleVisualizationFixture.cs b/src/Reveal.Sdk.Dom.Tests/Visualizations/BubbleVisualizationFixture.cs index 8c963707..795b0887 100644 --- a/src/Reveal.Sdk.Dom.Tests/Visualizations/BubbleVisualizationFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Visualizations/BubbleVisualizationFixture.cs @@ -129,147 +129,164 @@ public void ToJsonString_GeneratesCorrectJson_WhenSerialized() // Arrange var expectedJson = """ - [ { - "Description" : "Bubble Visualization", - "Id" : "60344a4a-d0ce-4364-9f8c-acfbb8caa32e", - "Title" : "Bubble Visualization", - "IsTitleVisible" : true, - "ColumnSpan" : 0, - "RowSpan" : 0, - "VisualizationSettings" : { - "_type" : "ChartVisualizationSettingsType", - "RightAxisLogarithmic" : false, - "LeftAxisLogarithmic" : true, - "ShowLegends" : true, - "BrushOffsetIndex" : 1, - "ChartType" : "Bubble", - "VisualizationType" : "CHART" - }, - "DataSpec" : { - "_type" : "TabularDataSpecType", - "IsTransposed" : false, - "Fields" : [ { - "FieldName" : "CampaignID", - "FieldLabel" : "CampaignID", - "UserCaption" : "CampaignID", - "IsCalculated" : false, - "Properties" : { }, - "Sorting" : "None", - "FieldType" : "String" - }, { - "FieldName" : "Budget", - "FieldLabel" : "Budget", - "UserCaption" : "Budget", - "IsCalculated" : false, - "Properties" : { }, - "Sorting" : "None", - "FieldType" : "Number" - }, { - "FieldName" : "Spend", - "FieldLabel" : "Spend", - "UserCaption" : "Spend", - "IsCalculated" : false, - "Properties" : { }, - "Sorting" : "None", - "FieldType" : "Number" - }, { - "FieldName" : "Traffic", - "FieldLabel" : "Traffic", - "UserCaption" : "Traffic", - "IsCalculated" : false, - "Properties" : { }, - "Sorting" : "None", - "FieldType" : "Number" - } ], - "TransposedFields" : [ ], - "QuickFilters" : [ ], - "AdditionalTables" : [ ], - "ServiceAdditionalTables" : [ ], - "DataSourceItem" : { - "_type" : "DataSourceItemType", - "Id" : "080cc17d-4a0a-4837-aa3f-ef2571ea443a", - "Title" : "Marketing Sheet", - "Subtitle" : "Excel Data Source Item", - "DataSourceId" : "__EXCEL", - "HasTabularData" : true, - "HasAsset" : false, - "Properties" : { - "Sheet" : "Marketing" - }, - "Parameters" : { }, - "ResourceItem" : { - "_type" : "DataSourceItemType", - "Id" : "d593dd79-7161-4929-afc9-c26393f5b650", - "Title" : "Marketing Sheet", - "Subtitle" : "Excel Data Source Item", - "DataSourceId" : "33077d1e-19c5-44fe-b981-6765af3156a6", - "HasTabularData" : true, - "HasAsset" : false, - "Properties" : { - "Url" : "http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx" + [ + { + "Description": "Bubble Visualization", + "Id": "60344a4a-d0ce-4364-9f8c-acfbb8caa32e", + "Title": "Bubble Visualization", + "IsTitleVisible": true, + "ColumnSpan": 0, + "RowSpan": 0, + "VisualizationSettings": { + "_type": "ChartVisualizationSettingsType", + "RightAxisLogarithmic": false, + "ShowAxisX": true, + "ShowAxisY": true, + "LeftAxisLogarithmic": true, + "ShowLegends": true, + "BrushOffsetIndex": 1, + "ChartType": "Bubble", + "VisualizationType": "CHART" + }, + "DataSpec": { + "_type": "TabularDataSpecType", + "IsTransposed": false, + "Fields": [ + { + "FieldName": "CampaignID", + "FieldLabel": "CampaignID", + "UserCaption": "CampaignID", + "IsCalculated": false, + "Properties": {}, + "Sorting": "None", + "FieldType": "String" + }, + { + "FieldName": "Budget", + "FieldLabel": "Budget", + "UserCaption": "Budget", + "IsCalculated": false, + "Properties": {}, + "Sorting": "None", + "FieldType": "Number" + }, + { + "FieldName": "Spend", + "FieldLabel": "Spend", + "UserCaption": "Spend", + "IsCalculated": false, + "Properties": {}, + "Sorting": "None", + "FieldType": "Number" + }, + { + "FieldName": "Traffic", + "FieldLabel": "Traffic", + "UserCaption": "Traffic", + "IsCalculated": false, + "Properties": {}, + "Sorting": "None", + "FieldType": "Number" + } + ], + "TransposedFields": [], + "QuickFilters": [], + "AdditionalTables": [], + "ServiceAdditionalTables": [], + "DataSourceItem": { + "_type": "DataSourceItemType", + "Id": "080cc17d-4a0a-4837-aa3f-ef2571ea443a", + "Title": "Marketing Sheet", + "Subtitle": "Excel Data Source Item", + "DataSourceId": "__EXCEL", + "HasTabularData": true, + "HasAsset": false, + "Properties": { + "Sheet": "Marketing" }, - "Parameters" : { } + "Parameters": {}, + "ResourceItem": { + "_type": "DataSourceItemType", + "Id": "d593dd79-7161-4929-afc9-c26393f5b650", + "Title": "Marketing Sheet", + "Subtitle": "Excel Data Source Item", + "DataSourceId": "33077d1e-19c5-44fe-b981-6765af3156a6", + "HasTabularData": true, + "HasAsset": false, + "Properties": { + "Url": "http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx" + }, + "Parameters": {} + } + }, + "Expiration": 1440, + "Bindings": { + "Bindings": [] } }, - "Expiration" : 1440, - "Bindings" : { - "Bindings" : [ ] + "VisualizationDataSpec": { + "_type": "BubbleVisualizationDataSpecType", + "Radius": [ + { + "_type": "MeasureColumnSpecType", + "SummarizationField": { + "_type": "SummarizationValueFieldType", + "FieldLabel": "Traffic", + "UserCaption": "Traffic", + "IsHidden": false, + "AggregationType": "Sum", + "Sorting": "None", + "IsCalculated": false, + "FieldName": "Traffic" + } + } + ], + "XAxis": [ + { + "_type": "MeasureColumnSpecType", + "SummarizationField": { + "_type": "SummarizationValueFieldType", + "FieldLabel": "Budget", + "UserCaption": "Budget", + "IsHidden": false, + "AggregationType": "Sum", + "Sorting": "None", + "IsCalculated": false, + "FieldName": "Budget" + } + } + ], + "YAxis": [ + { + "_type": "MeasureColumnSpecType", + "SummarizationField": { + "_type": "SummarizationValueFieldType", + "FieldLabel": "Spend", + "UserCaption": "Spend", + "IsHidden": false, + "AggregationType": "Sum", + "Sorting": "None", + "IsCalculated": false, + "FieldName": "Spend" + } + } + ], + "FormatVersion": 0, + "AdHocExpandedElements": [], + "Rows": [ + { + "_type": "DimensionColumnSpecType", + "SummarizationField": { + "_type": "SummarizationRegularFieldType", + "DrillDownElements": [], + "ExpandedItems": [], + "FieldName": "CampaignID" + } + } + ] } - }, - "VisualizationDataSpec" : { - "_type" : "BubbleVisualizationDataSpecType", - "Radius" : [ { - "_type" : "MeasureColumnSpecType", - "SummarizationField" : { - "_type" : "SummarizationValueFieldType", - "FieldLabel" : "Traffic", - "UserCaption" : "Traffic", - "IsHidden" : false, - "AggregationType" : "Sum", - "Sorting" : "None", - "IsCalculated" : false, - "FieldName" : "Traffic" - } - } ], - "XAxis" : [ { - "_type" : "MeasureColumnSpecType", - "SummarizationField" : { - "_type" : "SummarizationValueFieldType", - "FieldLabel" : "Budget", - "UserCaption" : "Budget", - "IsHidden" : false, - "AggregationType" : "Sum", - "Sorting" : "None", - "IsCalculated" : false, - "FieldName" : "Budget" - } - } ], - "YAxis" : [ { - "_type" : "MeasureColumnSpecType", - "SummarizationField" : { - "_type" : "SummarizationValueFieldType", - "FieldLabel" : "Spend", - "UserCaption" : "Spend", - "IsHidden" : false, - "AggregationType" : "Sum", - "Sorting" : "None", - "IsCalculated" : false, - "FieldName" : "Spend" - } - } ], - "FormatVersion" : 0, - "AdHocExpandedElements" : [ ], - "Rows" : [ { - "_type" : "DimensionColumnSpecType", - "SummarizationField" : { - "_type" : "SummarizationRegularFieldType", - "DrillDownElements" : [ ], - "ExpandedItems" : [ ], - "FieldName" : "CampaignID" - } - } ] } - } ] + ] """; var document = new RdashDocument("My Dashboard"); diff --git a/src/Reveal.Sdk.Dom.Tests/Visualizations/ScatterVisualizationFixture.cs b/src/Reveal.Sdk.Dom.Tests/Visualizations/ScatterVisualizationFixture.cs index aa2c9999..f62f7cb1 100644 --- a/src/Reveal.Sdk.Dom.Tests/Visualizations/ScatterVisualizationFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Visualizations/ScatterVisualizationFixture.cs @@ -108,124 +108,138 @@ public void ToJsonString_GeneratesCorrectJson_WhenSerialized() // Arrange var expectedJson = """ - [ { - "Id" : "bf34a18c-21fc-4d4e-bb22-dc123f8c00de", - "Title" : "Scatter Visualization", - "IsTitleVisible" : true, - "ColumnSpan" : 0, - "RowSpan" : 0, - "VisualizationSettings" : { - "_type" : "ChartVisualizationSettingsType", - "RightAxisLogarithmic" : false, - "LeftAxisLogarithmic" : false, - "ShowLegends" : true, - "ChartType" : "Scatter", - "VisualizationType" : "CHART" - }, - "DataSpec" : { - "_type" : "TabularDataSpecType", - "IsTransposed" : false, - "Fields" : [ { - "FieldName" : "CampaignID", - "FieldLabel" : "CampaignID", - "UserCaption" : "CampaignID", - "IsCalculated" : false, - "Properties" : { }, - "Sorting" : "None", - "FieldType" : "Number" - }, { - "FieldName" : "Budget", - "FieldLabel" : "Budget", - "UserCaption" : "Budget", - "IsCalculated" : false, - "Properties" : { }, - "Sorting" : "None", - "FieldType" : "Number" - }, { - "FieldName" : "Spend", - "FieldLabel" : "Spend", - "UserCaption" : "Spend", - "IsCalculated" : false, - "Properties" : { }, - "Sorting" : "None", - "FieldType" : "Number" - } ], - "TransposedFields" : [ ], - "QuickFilters" : [ ], - "AdditionalTables" : [ ], - "ServiceAdditionalTables" : [ ], - "DataSourceItem" : { - "_type" : "DataSourceItemType", - "Id" : "080cc17d-4a0a-4837-aa3f-ef2571ea443a", - "Title" : "Marketing Sheet", - "Subtitle" : "Excel Data Source Item", - "DataSourceId" : "__EXCEL", - "HasTabularData" : true, - "HasAsset" : false, - "Properties" : { - "Sheet" : "Marketing" - }, - "Parameters" : { }, - "ResourceItem" : { - "_type" : "DataSourceItemType", - "Id" : "d593dd79-7161-4929-afc9-c26393f5b650", - "Title" : "Marketing Sheet", - "Subtitle" : "Excel Data Source Item", - "DataSourceId" : "33077d1e-19c5-44fe-b981-6765af3156a6", - "HasTabularData" : true, - "HasAsset" : false, - "Properties" : { - "Url" : "http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx" + [ + { + "Id": "bf34a18c-21fc-4d4e-bb22-dc123f8c00de", + "Title": "Scatter Visualization", + "IsTitleVisible": true, + "ColumnSpan": 0, + "RowSpan": 0, + "VisualizationSettings": { + "_type": "ChartVisualizationSettingsType", + "RightAxisLogarithmic": false, + "ShowAxisX": true, + "ShowAxisY": true, + "LeftAxisLogarithmic": false, + "ShowLegends": true, + "ChartType": "Scatter", + "VisualizationType": "CHART" + }, + "DataSpec": { + "_type": "TabularDataSpecType", + "IsTransposed": false, + "Fields": [ + { + "FieldName": "CampaignID", + "FieldLabel": "CampaignID", + "UserCaption": "CampaignID", + "IsCalculated": false, + "Properties": {}, + "Sorting": "None", + "FieldType": "Number" + }, + { + "FieldName": "Budget", + "FieldLabel": "Budget", + "UserCaption": "Budget", + "IsCalculated": false, + "Properties": {}, + "Sorting": "None", + "FieldType": "Number" + }, + { + "FieldName": "Spend", + "FieldLabel": "Spend", + "UserCaption": "Spend", + "IsCalculated": false, + "Properties": {}, + "Sorting": "None", + "FieldType": "Number" + } + ], + "TransposedFields": [], + "QuickFilters": [], + "AdditionalTables": [], + "ServiceAdditionalTables": [], + "DataSourceItem": { + "_type": "DataSourceItemType", + "Id": "080cc17d-4a0a-4837-aa3f-ef2571ea443a", + "Title": "Marketing Sheet", + "Subtitle": "Excel Data Source Item", + "DataSourceId": "__EXCEL", + "HasTabularData": true, + "HasAsset": false, + "Properties": { + "Sheet": "Marketing" }, - "Parameters" : { } + "Parameters": {}, + "ResourceItem": { + "_type": "DataSourceItemType", + "Id": "d593dd79-7161-4929-afc9-c26393f5b650", + "Title": "Marketing Sheet", + "Subtitle": "Excel Data Source Item", + "DataSourceId": "33077d1e-19c5-44fe-b981-6765af3156a6", + "HasTabularData": true, + "HasAsset": false, + "Properties": { + "Url": "http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx" + }, + "Parameters": {} + } + }, + "Expiration": 1440, + "Bindings": { + "Bindings": [] } }, - "Expiration" : 1440, - "Bindings" : { - "Bindings" : [ ] + "VisualizationDataSpec": { + "_type": "ScatterVisualizationDataSpecType", + "XAxis": [ + { + "_type": "MeasureColumnSpecType", + "SummarizationField": { + "_type": "SummarizationValueFieldType", + "FieldLabel": "Budget", + "UserCaption": "Budget", + "IsHidden": false, + "AggregationType": "Sum", + "Sorting": "None", + "IsCalculated": false, + "FieldName": "Budget" + } + } + ], + "YAxis": [ + { + "_type": "MeasureColumnSpecType", + "SummarizationField": { + "_type": "SummarizationValueFieldType", + "FieldLabel": "Spend", + "UserCaption": "Spend", + "IsHidden": false, + "AggregationType": "Sum", + "Sorting": "None", + "IsCalculated": false, + "FieldName": "Spend" + } + } + ], + "FormatVersion": 0, + "AdHocExpandedElements": [], + "Rows": [ + { + "_type": "DimensionColumnSpecType", + "SummarizationField": { + "_type": "SummarizationRegularFieldType", + "DrillDownElements": [], + "ExpandedItems": [], + "FieldName": "CampaignID" + } + } + ] } - }, - "VisualizationDataSpec" : { - "_type" : "ScatterVisualizationDataSpecType", - "XAxis" : [ { - "_type" : "MeasureColumnSpecType", - "SummarizationField" : { - "_type" : "SummarizationValueFieldType", - "FieldLabel" : "Budget", - "UserCaption" : "Budget", - "IsHidden" : false, - "AggregationType" : "Sum", - "Sorting" : "None", - "IsCalculated" : false, - "FieldName" : "Budget" - } - } ], - "YAxis" : [ { - "_type" : "MeasureColumnSpecType", - "SummarizationField" : { - "_type" : "SummarizationValueFieldType", - "FieldLabel" : "Spend", - "UserCaption" : "Spend", - "IsHidden" : false, - "AggregationType" : "Sum", - "Sorting" : "None", - "IsCalculated" : false, - "FieldName" : "Spend" - } - } ], - "FormatVersion" : 0, - "AdHocExpandedElements" : [ ], - "Rows" : [ { - "_type" : "DimensionColumnSpecType", - "SummarizationField" : { - "_type" : "SummarizationRegularFieldType", - "DrillDownElements" : [ ], - "ExpandedItems" : [ ], - "FieldName" : "CampaignID" - } - } ] } - } ] + ] """; var document = new RdashDocument("My Dashboard");