ChartJS - Line Chart - Y axis scale problem ?
Line Chart - Y axis scale problem ?
by Renjith VR
HTML
<script src="http://www.chartjs.org/assets/Chart.js"></script>
<body>
<h3>Working Chart</h3>
<canvas id="canvas" height="450" width="600"></canvas>
</body>
CSS
canvas { background-color : #eee;
}
JavaScript
var data = {
labels: [1,2,3,4,5,6,7,8,9,10],
datasets: [
{
label: "My First dataset",
fillColor: "#fff",
strokeColor: "rgba(241, 196, 15, 0.5)",
pointColor: "rgba(241, 196, 15, 0.5)",
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(241, 196, 15, 0.5)",
scaleOverride:true,
data: [12,25,22,20,18,21,23,16,24,20]
},
{
labels: [1,2,3,4,5,6,7,8,9,10],
fillColor: "rgba(230, 126, 34, 0.5)",
strokeColor: "rgba(230, 126, 34, 0.5)",
pointColor: "rgba(230, 126, 34, 0.5)",
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(230, 126, 34, 0.5)",
data: [23,15,25,12,19,15,18,22,16,18]
}
]
};
var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(data);