I’m using the LineChart component in a HubSpot UI extension. My data contains Unix timestamps, but when I set fieldType: 'datetime' for the x-axis, the chart doesn’t display the date properly. I converted the timestamps to ISO 8601 format using new Date(item.Date).toISOString(), but it still doesn’t work as expected. How should I format the date for proper rendering in the LineChart?
Here is my code snippet related to LineChart axises:
axes={{
x: { field: 'Date', fieldType: 'datetime' },
y: { field: 'Value', fieldType: 'category' },
options: { groupFieldByColor: 'Breakdown' },
}}
Here is my test data:
const myData = [
{ Date: 1728661545534, Breakdown: 'firstname', Value: 'value x' },
{ Date: 1727957473752, Breakdown: 'firstname', Value: 'value y' },
{ Date: 1727957473752, Breakdown: 'lastname', Value: 'value z' },
];
and here is the error I receive:
Highcharts error #14: www.highcharts.com/errors/14/
So, is any has any clue? I want to show some string values on “Y” axis with their Date which I provided on timestamps!
Super curious to know the answer, thx!