Label interval adjust according to screen size - CanvasJS

Label interval adjust according to screen size - CanvasJS

by canvasjs

HTML

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<body>
<div id="chartContainer" style="width:100%; height:300px"></div>
</body>

JavaScript

var chart = new CanvasJS.Chart("chartContainer", {
	title: {
		text: "Label Interval Adjust Accroding To Screen Size",
	},
	axisX: {
		valueFormatString: "DD/MMM",		
	},
	data: [
	{
		type: "line",
		xValueType: "dateTime",
		dataPoints: [
			{ x: 1345746600000, y: 450},
			{ x: 1345833000000, y: 414},
			{ x: 1347388200000, y: 520}
		]
	},
	{
		type: "line",
		xValueType: "dateTime",
		dataPoints: [
			{ x: 1345746600000, y: 350},
			{ x: 1345833000000, y: 514},
			{ x: 1347388200000, y: 420}
			]
	},
	{
		type: "line",
		xValueType: "dateTime",
		dataPoints: [
			{ x: 1345746600000, y: 250},
			{ x: 1345833000000, y: 314},
			{ x: 1347388200000, y: 220}
		]
	}
	]
});
chart.render();