Level 20
You must fill the chart with your json, don't you ? Not the DOM element.
Where is your chart instantiation ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
function onChartClick(e){
jQuery.ajax({
url: "./pipsubchart",
type: "GET",
data: {
_token: '{{csrf_token()}}',
pip_type: e.dataPoint.name,
currMonth: jQuery("#chartMonth").val(),
currYear: jQuery("#chartYear").val()
},
success: function(data) {
data.forEach(function(value) {
value.x = new Date(value.x);
});
document.getElementById("result").innerHTML = JSON.stringify(data);
}
});
}
I am passiing this above JSON in canvas JS charts datapoints but, it asks for date object as a input value,
My concern is i have already converted the date value into object but when i used JSON.stringify() It again changed the value to string.
Please or to participate in this conversation.