Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CategoryVisualizationDataSpec in grids #64

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public enum DataSourceProvider
[EnumMember(Value = "DROPBOXPROVIDER")]
Dropbox,

[EnumMember(Value = "GOOGLE_ADS")]
GoogleAds,

[EnumMember(Value = "GOOGLE_ANALYTICS")]
GoogleAnalytics,

Expand Down
13 changes: 11 additions & 2 deletions src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ public GridVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceI
public GridVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Grid; }

[JsonIgnore]
public List<TabularColumn> Columns { get { return VisualizationDataSpec.Columns; } }
public List<TabularColumn> Columns { get {
if (VisualizationDataSpec is GridVisualizationDataSpec gds)
{
return gds.Columns;
}
else
{
return new List<TabularColumn>();
}
} }

[JsonProperty(Order = 7)]
GridVisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec();
VisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec();
}
}
Loading