Hi there again, this time I’m facing a new minor issue, the thing is this, I have a Geo Map with some configurations and also an external query that adds a shape layer after the execution is finished. My code looks like the follow one:
// ...
let metric = new cf.Metric('metric', 'sum')
.label('Metric Custom Label')
.hideFunction();
cf.provider('Elasticsearch')
.source(source)
.rows(...rows)
.metrics(metric)
.filters(filters)
.element(extQueryId)
.on('execute:stop', (event) => {
const rows = cf.getVisualization(event.element).get().rows;
let shapeConfig = {
'name': 'State',
'shape': shapesUrl + '/usa-states.json',
'options': {
'featureProperty': featureProperty,
'color': shapeColor,
'shapeMetrics': [metric],
'allowClick': options.allowClick || false,
'showLocation': options.showLocation,
'shapeOpacity': options.shapeOpacity,
'shapeOpacityHl': options.borderHighlight,
'shapeBorderWeightHl': options.shapeBorderWeightHl || 2,
'shapeBorderColor': 'black',
'rows': rows
}
};
if (options.dataField) {
shapeConfig.options.dataField = options.dataField;
}
const viz = cf.getVisualization('geo-map-viz-id').get('visual');
viz.removeShapeLayer(shapeConfig.name);
viz.addShapeLayer(shapeConfig, event.data);
})
.execute();
In my metadata config i have the metric field configured with that type MONEY
as bellow:
"metadata": {
"fields": {
"metric": {
"label": "Metric Label",
"type": "MONEY"
}
}
}
When the tooltip is performed the value of the metric is showing as INTEGER
instead of MONEY
. Any thought about it?
Thanks…