Line Chart with multiple colors - CanvasJS JavaScript Charts
Line Chart with multiple colors - CanvasJS JavaScript Charts
by canvasjs
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer",
{
data: [
{
type: "line",
dataPoints: [
{ x: 10, y: 90 },
{ x: 20, y: 55 }
]
},
{
type: "line",
dataPoints: [
{ x: 20, y: 55 },
{ x: 30, y: 65 }
]
},
{
type: "line",
dataPoints: [
{ x: 30, y: 65 },
{ x: 40, y: 55 }
]
}
]
});
chart.render();