Spline Chart with Axis Labels & Indexlabels | CanvasJS JavaScript Charts
Spline Chart with Axis Labels & Indexlabels | 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", {
title: {
text: "Spline Chart with Axis Labels"
},
axisX: {
interval: 10
},
data: [{
type: "spline",
indexLabel: "{x}: {y}",
dataPoints: [
{ x: 10, y: 5, label: "Ten" },
{ x: 20, y: 9, label: "Twenty" },
{ x: 30, y: 17, label: "Thirty" },
{ x: 40, y: 32, label: "Forty" },
{ x: 50, y: 22, label: "Fifty" }
]
}]
});
chart.render();