Formatting toolTip's x value in dataSeries - CanvasJS
Formatting toolTip's x value in dataSeries - CanvasJS
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:"Formatting toolTip"
},
data: [
{
type: "stepLine",
xValueFormatString:"DD MMM YYYY",
toolTipContent: "x: {x}",
dataPoints: [
{ x: new Date(2016, 1, 1), y: 71 },
{ x: new Date(2016, 2, 2), y: 55},
{ x: new Date(2016, 3, 3), y: 50 },
{ x: new Date(2016, 4, 4), y: 65 },
{ x: new Date(2016, 5, 5), y: 95 },
{ x: new Date(2016, 7, 6), y: 68 },
{ x: new Date(2016, 8, 7), y: 28 },
{ x: new Date(2016, 10, 8), y: 34 },
{ x: new Date(2016, 11, 9), y: 14}
]
}
]
});
chart.render();