http://www.fyrobe-club-sisseln.ch/labor2/parse_text_files_retentions.php
The JSON above shall be convertet into a CanvasJS graph, i already tried the following:
$.getJSON( 'parse_text_files_retentions.php', function( data ){
var chart = new CanvasJS.Chart("chartContainer", {
title :{
text: "Retention"
},
axisX: {
title: "Retention time"
},
axisY: {
title: "Peak signal"
},
zoomEnabled: true,
panEnabled: true,
data: data
});
chart.render();
});
and
$.getJSON( 'parse_text_files_retentions.php', function( data ){
var chart = new CanvasJS.Chart("chartContainer", {
title :{
text: "Retention"
},
axisX: {
title: "Retention time"
},
axisY: {
title: "Peak signal"
},
zoomEnabled: true,
panEnabled: true
});
for( x=0, y=data.length; x<y; x++ ){
//Iterate Files
chart.options.data[y].type = 'column';
for( i=0, j=data[y].dataPoints.length; i<j; i++ ){
chart.options.data[y].dataPoints.push( { x : data[y].dataPoints[i].x, y : data[y].dataPoints[i].y });
}
}
chart.render();
});
Both doesn’t work (obviously). I get a blank graph with only the correct axes and title. Where am I wrong with including the data points?
Thank you very much in advance
-
This topic was modified 9 years, 8 months ago by Nightflyer.