Changing xDateFormat in highchart tooltip programatically -
i'm attempting change tooltip xdateformat programmatically. i'm calling:
chart.tooltip.options.xdateformat = getdateformatstring(newvalue.timeinterval); chart.redraw();
however, that's not doing need do. i'm playing around jsfiddle (pardon lack of knowledge of jquery, i'm writing in angular).
thanks!
here's example changes formatter instead of trying change xdateformat. http://jsfiddle.net/eyyh6/
$("button").click(function() { $(this).attr('disabled','disabled'); chart.tooltip.options.formatter = function() { var s = '<b>'+ highcharts.dateformat('%b %e %y %h:%m', this.x, true) +'</b>'; $.each(this.points, function(i, point) { s += '<br/>'+ point.series.name +': '+ point.y +'m'; }); return s; } });
edit: undocumented way change xdateformat
$("button").click(function() { $(this).attr('disabled','disabled'); chart.series[0].tooltipoptions.xdateformat = '%b %e %y %h:%m'; });
Comments
Post a Comment