Skip to content

Commit

Permalink
Merge pull request #118 from RevealBi/single-value-label-Visualizatio…
Browse files Browse the repository at this point in the history
…nSpec-type-change

Fix parsing errors for SingleValueLabelsVisualization
  • Loading branch information
brianlagunas authored Dec 3, 2024
2 parents b00a88b + 7df0adc commit cedb27d
Showing 1 changed file with 29 additions and 3 deletions.
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();
}
}

0 comments on commit cedb27d

Please sign in to comment.