Basic HTML5 Chart Example - CanvasJS
Basic HTML5 Chart Example
HTML
<script src="http://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer",
{
axisY : {
valueFormatString : '#,##0,.#"k"' // doesn't work
//valueFormatString : '#,##0,.#' // works as expected
//valueFormatString : '#,##0"k"' // also works as expected
/* Pay attention to the 1k and 2k values on the Y-axis */
},
data: [
{
type: "column",
dataPoints: [
{ x: 10, y: 1710 },
{ x: 20, y: 550 },
{ x: 30, y: 500 },
{ x: 40, y: 650 },
{ x: 50, y: 950 },
{ x: 60, y: 600 },
{ x: 70, y: 1900 },
{ x: 80, y: 1340 },
{ x: 90, y: 1400 }
]
}
]
});
chart.render();