Scale
Default | Custom scales |
10 20 30 40 50 60 70 80 '02 '03 '04 '05 '06 '07 '08 '09 '10 '11 |
Sales 0 20 40 60 80 100 '02 '03 '04 '05 '06 '07 '08 '09 '10 '11 Year |
Default | Custom scales |
10 20 30 40 50 60 70 80 '02 '03 '04 '05 '06 '07 '08 '09 '10 '11 |
Sales 0 20 40 60 80 100 '02 '03 '04 '05 '06 '07 '08 '09 '10 '11 Year |
<script src="../../codebase/dhtmlxchart.js" type="text/javascript"></script> <link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxchart.css"> <script src="../common/testdata.js"></script> <style> .scale{ font-size: 11px } </style> <script></script> <table> <tr> <td>Default</td> <td>Custom scales</td> </tr> <tr> <td><div id="chart1" style="width:400px;height:250px;border:1px solid #A4BED4;"></div></td> <td><div id="chart2" style="width:400px;height:250px;border:1px solid #A4BED4;"></div></td> </tr> </table>window.onload = function() { var chart1 = new dhtmlXChart({ view: "area", container: "chart1", value: "#sales#", alpha: 0.8, color: "#36abee", xAxis: { template: "'#year#"; }, yAxis: {} }); chart1.parse(dataset, "json"); var chart2 = new dhtmlXChart({ view: "area", container: "chart2", color: "#58dccd", alpha: 0.8, value: "#sales#", tooltip: { template: "#sales#"; }, xAxis: { template: "<span class='scale'>'#year#</span>", title: "Year"; }, yAxis: { start: 0, step: 10, end: 100, template: function(value) { return "<span class='scale'>" + (value % 20 ? "": value) + "</span>"; }, title: "Sales"; } }); chart2.parse(dataset, "json"); }