gpt4 book ai didi

highcharts - 删除 Highcharts x 轴标签千位分隔符

转载 作者:行者123 更新时间:2023-12-01 22:40:17 27 4
gpt4 key购买 nike

我的 X 轴包含年份。如何删除格式中的千位分隔符?或者我如何告诉 Highcharts 这是一年?

http://jsfiddle.net/nicholasduffy/BDQVV/

$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column',
},
xAxis : {
label: {
formatter: function () {
return Highcharts.numberFormat(this.x, 0, '', ''); // Remove the thousands sep?
}
}
},
series: [{"data": [[2006, 1], [2007, 5], [2008, 7], [2009, 7], [2010, 13], [2011, 14], [2012, 16], [2013, 20]], "name": "Series1"}, {"data": [[2012, 3], [2013, 3]], "name": "Series2"}, {"data": [[2002, 1], [2003, 1], [2004, 6], [2005, 7], [2006, 10], [2007, 17], [2008, 23], [2009, 25], [2010, 34], [2011, 44], [2012, 51], [2013, 64]], "name": "Series3"}]
});
});

最佳答案

你很接近。是标签,不是标签。还有,这个值是this.value,不是this.x

xAxis : {
labels: {
formatter: function () {
return Highcharts.numberFormat(this.value, 0, '', ''); // Remove the thousands sep?
}
}
},

http://jsfiddle.net/H2XQR/

关于highcharts - 删除 Highcharts x 轴标签千位分隔符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15460827/

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