如何在响应式高图中将工具提示组合在一起

时间:2017-11-06 03:56:54

标签: javascript html css highcharts

Here is the image of what i actually want as a final output

http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/demo/responsive/ 以上是Highcharts的链接,我希望在一个工具提示中组合日期工具提示的值和股票的价值。我该怎么办?

highcharts

2 个答案:

答案 0 :(得分:1)

相应地检查tooltip.formatter格式

tooltip: {
  useHTML: true,
  formatter: function() {
    return '<small>' +
      Highcharts.dateFormat('%A,%b %d,%Y',
        new Date(this.x)) + '</small><br> '+
                "<span style='color:" + this.points[0].series.color +
                "'>\u25CF</span> " + this.points[0].series.name + ': <b> ' + this.y + '</b>';
  }
},

Fiddle演示

答案 1 :(得分:0)

最简单的方法是将工具提示的split属性设置为false值,并将系列名称更改为&#39; AAPL&#39;。

API参考:
https://api.highcharts.com/highcharts/tooltip.split

例:
http://jsfiddle.net/896xsskw/