javascript - highcharts, possible bug setting tooltip formatter and html? -
i have set these options:
tooltip: { shared: true, usehtml: true, formatter: function() { return '<table style="text-align: center"><tr><td>{point.x:%y-%b-%e}</td></tr><tr><td>price: {point.y}</td></tr></table>'; } but still output.

if use:
tooltip: { shared: true, usehtml: true, headerformat: '<table style="text-align: center"><tr><td>{point.x:%y-%b-%e}</td></tr><tr><td>price: {point.y}</td></tr></table>', pointformat: '', footerformat: '', valuedecimals: 2 }, then get:

however, when zoom out or 10 year period, same output first.

there seems bug when around 3 years used.
here jsfiddle demonstrates error:
https://jsfiddle.net/3ld2zmum/2/
zoom out all
in formatter should use reference point object , highcharts.dateformat
formatter: function () { return '<table style="text-align: center"><tr><td>' + (highcharts.dateformat('%y-%b-%e', this.x)) + '</td></tr><tr><td>price: ' + this.y + ' </td></tr></table>'; },
Comments
Post a Comment