Highcharts - Wrong date in tooltip -
fiddle - http://jsfiddle.net/z8fw7/
when hover on column can see weird big number, coming from.
if add 1 more date entry. e.g
[date.utc(2010,2,31), 28.84], [date.utc(2011,2,31), 28.84], [date.utc(2012,2,31), 32.65]
the tooltip displays proper year value expected. works flawlessly 3 data values while not work 2 data values. how can make sure works 2 data values.
looks bug in highcharts 2 data points when using pointformat
. suggest using more customizable formatter
function.
so in option configuring tooltip
, use this:
tooltip: { formatter: function() { var date = new date(this.x); var year = date.getfullyear(); return year + '<br/>' + '<span style="color:'+this.series.color+'">'+ this.series.name +'</span>: '+ this.y + '%'; }, }
works fine 2 data points or 3, etc. see: http://jsfiddle.net/uqbkq/
Comments
Post a Comment