gpt4 book ai didi

java - Highchart 工具提示值的格式应基于区域设置

转载 作者:行者123 更新时间:2023-12-01 19:18:38 24 4
gpt4 key购买 nike

例如,我想显示以下格式:

意大利格式:1.325.000美国格式:1,325,000等等

但是 highchart 使用以下响应显示另一种格式。基于区域设置,它动态显示工具提示中的值。我正在尝试以下回复。

Highcharts.chart('container', {
"tooltip" : {
"shared" : true
},
"legend" : {
"enabled" : true,
"reversed" : false
},
"credits" : {
"enabled" : false
},
"exporting" : {
"enabled" : false
},
"chart" : {
"zoomType" : "xy"
},
"title" : {
"text" : "Financial analytic"
},
"xAxis" : [ {
"categories" : [ "Amar", "Kiran", "Venkatesh" ],
"crosshair" : true
} ],
"yAxis" : [ {
"title" : {
"text" : "Financial"
},
"labels" : {
"format" : "${value:.2f}USD"
}
} ],
"series" : [ {
"type" : "column",
"name" : "Financial",
"data" : [ 1325000.0, 1740000.0, 1560000.0 ],
"tooltip" : {
"valueDecimals" : 2,
"valuePrefix" : "$",
"valueSuffix" : "USD"
},
"yAxis" : 0
}]

});

最佳答案

您需要在lang选项中设置thousandsSep:

Highcharts.setOptions({
lang: {
thousandsSep: ','
}
});
<小时/>

现场演示: http://jsfiddle.net/BlackLabel/4m79t50g/1/

API引用: https://api.highcharts.com/gantt/lang.thousandsSep

关于java - Highchart 工具提示值的格式应基于区域设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59387326/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com