I have a line chart with xAxis
values as timestamps and yAxis
values has a number. The definition is easy:
xAxis : [ {
type : 'datetime'
labels: {
formatter: function(){
// Custom function formatting timestamps
}
}
]
Data from my API come like this and works great.
data:[
[1558648800, 10256],
[1558648801, 10258],
[1558648802, 10259]
]
The issue now is that I need to show a message in a tooltip, so I found some solutions like https://stackoverflow.com/a/8515679.
data: [
{y : 10256, myData : 'Message 1'},
{y : 10258, myData : 'Message 2'},
{y : 10259, myData : 'Message 3'}
]
In this solution xAxis
data dissapears so the unique way that I found is using name
attribute as xAxis
, but I thought that is not the best while managing timestamps and autommatic tikcIntervals
.
(I delegate intervals on Highcharts, doesn't matter).
So my question is, what it would be the best way to create that extra attribute (myData) for tooltip, considering datetime with timestamps line chart?
Thanks in advance