You must be logged in to post your query.
Home › Forums › Feature Requests & Feedback › two csv in the same chart
Tagged: csv
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?
@lola123,
Please take a look at this JSFiddle.
Considering this to be a duplicate of this thread, hence closing it.
__ Priyanka M S Team CanvasJS
Thank you very much.
How i can make to see several charts on the same page with “Multi Series Chart from External CSV Data”
Please refer to this documentation on Render Multiple Charts in a Page for a step-by-step tutorial.
You must be logged in to reply to this topic. Login/Register