I am using a nivo line chart and want to use the x-Axis as a timeline, down to a minute. Unfortunatelly I can not render that chart because it fails to read the date properly. For example this is part of my data:
{ x: "2020-04-24T13:07:44.000+0000", y: 0.8063946735624102 }
this is the data the chart gets, generated with the following code:
let cpuEntry = {
x: data[i].created,
y: data[i].system_cpu
};
When I try to open the chart I get this error message:
Uncaught TypeError: v.getTime is not a function
After a bit of research I found out, the chart needs a Date obejct. I wrapped it like this:
x: new Date(data[i].created),
which gives me a result like this:
Fri Apr 24 2020 15:07:44 GMT+0200
and this error:
Uncaught Error: Objects are not valid as a React child (found: Fri Apr 24 2020 15:25:00 GMT+0200). If you meant to render a collection of children, use an array instead.
This is part of my configuration in the ResponsiveLine:
xScale={{
format: 'native',
type: 'time'
}}
I have read something about trying to use "toString()" but thats just a circle of the same errors. I hope someone can help me. If needed I will provide further information.