Chart with Y Values formatted to two decimals - CanvasJS JavaScript Charts
Chart with Y Values formatted to two decimals - 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: "column",
dataPoints: [
{ x: 10, y: 7100 },
{ x: 20, y: 5500 },
{ x: 30, y: 5000 },
{ x: 40, y: 6500 },
{ x: 50, y: 9500 },
{ x: 60, y: 6800 },
{ x: 70, y: 2800 },
{ x: 80, y: 3400 },
{ x: 90, y: 1400 }
]
}
],
axisY:{
valueFormatString: "#,##0.00"
}
});
chart.render();