Hi there,
thanks for providing this helpful library!
When using multiple values in a slot of type cont, it seems that the first value always defines the format of the caption of all the following values. For example, if I add a currency first and a quantity second, reading the caption for the quantity yields the quantity formatted as a currency and vice versa. Is it possible to obtain the correctly formatted values?

In this example "Einnahmen" is a currency and "Menge" is a quantity and both captions are formatted as a currency. When switching the order, thus having "Menge" first and "Einnahmen" second, both are formatted as a quantity.
Thanks for looking into this!
Samy
Minimal working example:
vizdef.xml:
<visualizationDefinition version="3.1" xmlns="http://www.ibm.com/xmlns/prod/ba/vipr/vizBundle/vizdef.3">
<slots>
<slot name="categories" caption="Categories" type="cat" optional="false" />
<slot name="values" caption="Values" type="cont" optional="false" />
</slots>
<dataSets>
<dataSet name="data">
<ref slot="categories" />
<ref slot="values" />
</dataSet>
</dataSets>
</visualizationDefinition>
Main.ts:
import {RenderBase} from "@businessanalytics/customvis-lib";
// data column indices
const CATEGORIES = 0, VALUES = 1;
export default class extends RenderBase {
protected create(_node: HTMLElement): HTMLElement {
return _node;
}
protected update(_info): void {
const rows = _info.data ? _info.data.rows : [];
for (let i = 0; i < rows.length; i++) {
console.log(rows[i].caption(CATEGORIES));
console.log(rows[i].caption(VALUES));
console.log(rows[i].value(VALUES));
}
}
}
Hi there,
thanks for providing this helpful library!
When using multiple values in a slot of type
cont, it seems that the first value always defines the format of the caption of all the following values. For example, if I add a currency first and a quantity second, reading the caption for the quantity yields the quantity formatted as a currency and vice versa. Is it possible to obtain the correctly formatted values?In this example "Einnahmen" is a currency and "Menge" is a quantity and both captions are formatted as a currency. When switching the order, thus having "Menge" first and "Einnahmen" second, both are formatted as a quantity.
Thanks for looking into this!
Samy
Minimal working example:
vizdef.xml:Main.ts: