Closed hski-github closed 2 years ago
In the sunburst chart we validate that there are no gaps in the hierarchy (empty value followed by value) by iterating the value array in the following way: https://github.com/TIBCOSoftware/spotfire-mods/blob/44174deab6ea04bb52d689bf2f6a55aaa5ac8a65/catalog/sunburst-chart/src/index.ts#L379
An alternative approach is to check the value()
of the DataViewHierarchyNode at that level in the hierarchy.
Thank you very much. Doing like this now in my own Mod.
if ( iconAxis.parts.length > 0 ){
var icon = row.categorical("Icon");
var iconNotEmpty = false;
icon.value().forEach(function(part){
if ( part.value() ) iconNotEmpty = true;
});
if ( iconNotEmpty ){
var iconValue = icon.formattedValue();
...
}
}
A value of a categorical axis can be empty. If I use
row.categorical(”Label”).formattedValue()
I get a localized string(empty)
or(Leer)
.What is the best way to check if this value is empty? Do I have to iterate over the value array and check each is empty? Or is there a simpler way to do it?