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

Fix parsing errors for SingleValueLabelsVisualization #118

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,38 @@ public abstract class SingleValueLabelsVisualizationBase<TSettings> : Visualizat
protected SingleValueLabelsVisualizationBase(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { }

[JsonIgnore]
public List<DimensionColumn> Labels { get { return VisualizationDataSpec.Rows; } }
public List<DimensionColumn> Labels {
get
{
if (VisualizationDataSpec is SingleValueLabelsVisualizationDataSpec vizSpec)
{
return vizSpec.Rows;
}
else
{
return new List<DimensionColumn>();
}
}
}

[JsonIgnore]
public List<MeasureColumn> Values { get { return VisualizationDataSpec.Value; } }
public List<MeasureColumn> Values {
get
{
if (VisualizationDataSpec is SingleValueLabelsVisualizationDataSpec vizSpec)
{
return vizSpec.Value;
}
else
{
return new List<MeasureColumn>();
}
}
}


//Some visualizations can be assigned a CategoryVisualizationDataSpec instead of a SingleValueLabelsVisualizationDataSpec
[JsonProperty(Order = 7)]
SingleValueLabelsVisualizationDataSpec VisualizationDataSpec { get; set; } = new SingleValueLabelsVisualizationDataSpec();
VisualizationDataSpec VisualizationDataSpec { get; set; } = new SingleValueLabelsVisualizationDataSpec();
}
}
Loading