我有一个Highchart Graph,它描绘了温度,风,压力和降雨量.
在这里可以看到http://www.dmjsystems.co.uk/weather/forecast.php
我正在使用一个共享的工具提示,其中增加了复杂性,即最大降雨量是雨水堆积列中的最小值和最大值.目前代码忽略了我的基于系列的后缀,我无法获得单个小数点(iethey all显示3位小数).
每个项目都有不同的后缀(Temp =(度符号)C,Wind = mph,Pressure = mb和Rain = in)和不同的小数位数(Wind = none,Temp = 1,Pressure = 1和Rain = 3).
我目前正在使用一般的Tooltip编码如下:
tooltip: { shared : true,
formatter: function() {
return '<span style="color:#039;font-weight:bold">' + Highcharts.dateFormat('%A' + ', ' + '%b %d' + ', ' + '%H' + ':' + '00',this.x) + '</span><br/>' +
this.points.map(function(point, idx) {
return '<span style="color:' + point.series.color + '">' + point.series.name +
'</span>: <span style="color:#669;font-weight:bold">' +
Highcharts.numberFormat((idx == 0) ? point.total : point.y,3) +
'</span>'; …Run Code Online (Sandbox Code Playgroud) highcharts ×1