TeeChart for JavaScript for the HTML5 Canvas
-
SenSeo
- Newbie
- Posts: 71
- Joined: Wed Mar 09, 2016 12:00 am
Post
by SenSeo » Tue May 10, 2016 12:54 pm
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;
}
-
Yeray
- Site Admin
- Posts: 9622
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Wed May 11, 2016 2:46 pm
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;
}