Page 1 of 1

Customozed Tool tip

Posted: Tue May 10, 2016 12:54 pm
by 15677821
As per my requirement I need to show the tooltip with values, datetime (x-axis value) and some comment on the chart. I am able to get the value of the chart but not datetime value. Can you please guide me how I can get datetime value using below code?

Code: Select all

       tip.ongettext = function (tool, text, series, index) {
                  
                        var s = 'Series1 point: <strong>' + index.toFixed(0) + '</strong><br/>Value: ' + series.data.values[index].toFixed(2);

return s;
}

Re: Customozed Tool tip

Posted: Wed May 11, 2016 2:46 pm
by yeray
Hello,

Having your DateTime values in your series data.x array, you can take that and format it as follows:

Code: Select all

  tip.ongettext = function (tool, text, series, index) {
    var s = 'Series1 point:' + index.toFixed(0) + ' X Value: ' + new Date(series.data.x[index]).toDateString();
    return s;
  }