HI,
I want creating one chart with two CSV files.
code js :
$.ajax({
type: “GET”,
url: “test1.csv”,
dataType: “text”,
success: function (data) {
processCSV1(data, “3000”, “3000”, “Info1”);
}
});
$.ajax({
type: “GET”,
url: “test2.csv”,
dataType: “text”,
success: function (data) {
processCSV1(data, “3000”, “000”, “Info1”);
}
});
function processCSV1(allText, containerID, titleText, axYTitle) {
var allLinesArray = allText.split(“\n”);
if (allLinesArray.length > 0) {
var dataPoints1 = [];
var dataPoints2 = [];
for (var i = 0; i <= allLinesArray.length – 1; i++) {
var rowData = allLinesArray[i].split(“;”);
dataPoints1.push({
label: rowData[0],
y: parseFloat(rowData[1])
});
dataPoints2.push({
label: rowData[0],
y: parseFloat(rowData[1])
});
}
var chart = new CanvasJS.Chart(containerID, {
animationEnabled: true,
zoomEnabled: true,
title: {
text: titleText,
fontSize: 25
},
axisX: {
title: “Graphe1”,
},
axisY: {
title: axYTitle,
},
legend: {
horizontalAlign: “center”,
verticalAlign: “top”,
fontSize: 15
},
data: [{
type: “line”,
markerType: “circle”,
dataPoints: dataPoints1
},
{
type: “line”,
markerType: “circle”,
dataPoints: dataPoints2
}]
});
chart.render();
}
}
it shows me that a curve, how i can do?