Horizontal and vertical scales can be set for bar charts and graphics. You may define them both or just one of them.
Scales have the following properties:
Each mark of the horizontal scale (xAxis property) corresponds to one data object.
The vertical scale (yAxis property) sets the top and bottom limits for displayed values. The marks of the scale are defined in scale configuration by the three properties:
The vertical scale also requires the same properties as the horizontal scale: template, title and lines.
var chart = new dhtmlXChart({ … xAxis:{ title: "Years", template: "#year#", lines: true }, yAxis:{ start:2, end:10, step:1, title:"Sales,mil" } }) var data = [ { sales:"3.0", year:"2000" }, { sales:"3.8", year:"2001" }, ... { sales:"4.8", year:"2009" } ]; chart.parse(data,"json");