Spline Area Chart with different color - CanvasJS JavaScript Charts
Spline Area Chart with different color - CanvasJS JavaScript Charts
by canvasjs
HTML
<script src="http://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: "splineArea",
color: 'rgb(90, 220, 0)',
dataPoints: [
{ x: 10, y: 71 },
{ x: 20, y: 55 },
{ x: 30, y: 50 },
{ x: 40, y: 10 },
{ x: 50, y: 0, markerSize: 0, highlightEnabled: false },
]
},
{
type: "splineArea",
color: 'rgb(170, 0, 0)',
dataPoints: [
{ x: 50, y: 0, markerSize: 0, highlightEnabled: false },
{ x: 60, y: -10 },
{ x: 70, y: -50 },
{ x: 75, y: 0, markerSize: 0, highlightEnabled: false },
]
},
{
type: "splineArea",
color: 'rgb(90, 220, 0)',
dataPoints: [
{ x: 75, y: 0, markerSize: 0, highlightEnabled: false },
{ x: 80, y: 20 },
{ x: 90, y: 14 }
]
}
]
});
chart.render();