Reputation: 428
I'm charting timeseries data in Highcharts with millisecond precision and it works fine, however when I bring up the data table it uses a different time format:
Is there a way to show milliseconds in the table? Thanks.
Upvotes: 1
Views: 195
Reputation: 7372
Unfortunately, Highcharts does not have the default option to show data in milliseconds (timestamp) in a data table. However, it can be done easily by wrapping Highcharts.Chart.prototype.getDataRows
method and map the data array used for plotting the table.
Wrapper code:
(function(H) {
H.wrap(H.Chart.prototype, 'getDataRows', function(proceed, multiLevelHeaders) {
var rows = proceed.call(this, multiLevelHeaders);
rows = rows.map(row => {
if (row.x) {
row[0] = H.dateFormat('%Y-%m-%y %H:%M:%S.%L', row.x);
}
return row;
});
return rows;
});
}(Highcharts));
Demo:
Upvotes: 1