单行系列如下:
https://www.highcharts.com/stock/demo/basic-line
最终图表应具有单线交易量
答案 0 :(得分:1)
您可以通过设置tooltip.split = false
并使用tooltip.formatter
回调来实现。
代码:
tooltip: {
split: false,
formatter: function() {
var point = this.point,
chart = point.series.chart,
pointIndex = point.index,
date = Highcharts.dateFormat('%b %e, %H:%M', this.x),
volumePoint = chart.series[1].points[pointIndex],
text =
'<span style="color:' + point.color +
'">\u25CF</span> ' + point.series.name +
': <b>' + point.y + '</b><br/>' +
'<br><span style="color:' + volumePoint.color +
'">\u25CF</span> ' +
'Volume: <b>' + volumePoint.y +
'</b><br>' + date;
return text;
}
}
演示:
API参考: