0
我们使用dimpleJs在图表的y轴上显示价格值。当价格超过100万时,它会在图表中显示时自动转换为1米。我希望以数千或10万/数十万的数量显示数百万,请参阅Indian Numbering System。怎么做?我已经搜索并尝试this答案 但它似乎不工作。下面是我的代码片段:如何显示百万在dimple测量轴为1000k而不是1m?
const yAxis = chart.addMeasureAxis('y', 'total');
yAxis.tickFormat = function(d) {
let result = d;
if ((d/1000) >= 1) {
result = d/1000 + 'K';
}
return result;
};