Hi, i have a date format like this 2019-01-26 07:25:01
as source and i want to use it in my canvasjs.
I use mysql too so i can’t really change it.
Here is my skript if can help:
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
title:{
text: "Utilizzo RAM"
},
axisY: {
title: "Utilizzo RAM in MB",
valueFormatString: "#0,,.",
suffix: "MB",
prefix: ""
},
data: [{
type: "spline",
markerSize: 5,
xValueFormatString: "YYYY-MM-DD HH:mm:ss",
yValueFormatString: "####MB",
xValueType: "dataTime",
dataPoints: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?>
}]
});
chart.render();
}
</script>
But, when i put it in my page, in the console i get this error:
canvasjs.min.js:209 Uncaught TypeError: Cannot read property 'getTime' of null
at l._processMultiseriesPlotUnit (canvasjs.min.js:209)
at l._processData (canvasjs.min.js:206)
at l.setLayout (canvasjs.min.js:189)
at l.render (canvasjs.min.js:201)
at window.onload (status.php:30)
l._processMultiseriesPlotUnit @ canvasjs.min.js:209
l._processData @ canvasjs.min.js:206
l.setLayout @ canvasjs.min.js:189
l.render @ canvasjs.min.js:201
window.onload @ status.php:30
load (async)
(anonymous) @ status.php:8
Then, i can see only a white space where there should be the canvas, but empty.
Somebody can help me?
Thanks advice!
-
This topic was modified 5 years, 9 months ago by GABRYCA.
-
This topic was modified 5 years, 9 months ago by GABRYCA.