我有一个非常简单的样条图,我试图在每个工具提示上显示所选点与前一个点的值之间的变化,以百分比变化衡量。基本上这是我要展示的工具提示格式
我一直在寻找解决方案,但我想出的唯一方法就是这个。
希望能帮助到你。
这是我的图表选项:
GeneralChartOptions = {
chart: {
renderTo: 'dummycontainer',
type: 'spline',
zoomType: 'x',
spacingRight: 20
},
credits: {
enabled: false
},
title: {
text: ''
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
month: '%b \'%y',
year: '%b'
}
},
yAxis: {
title: {
text: ''
},
plotLines: []
},
tooltip: {
xDateFormat: '%m-%Y',
shared: true,
crosshairs: true,
},
exporting: {
enabled: false
},
labels: {
formatter: function() {
return Highcharts.numberFormat(this.value, 2,".",",");
}
},
series: []
}
感谢您的帮助,我真的很感激。