HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function() {
2
3
// JSON data
4
var json = {
5
// chart settings
6
"chart": {
7
// chart type
8
"type": "column",
9
// chart title
10
"title": "Axes settings from JSON",
11
// series settings
12
"series": [{
13
// first series data
14
"data": [
15
{"x": "P1", "value": 128.14},
16
{"x": "P2", "value": 112.61},
17
{"x": "P3", "value": 163.21},
18
{"x": "P4", "value": 229.98},
19
{"x": "P5", "value": 90.54}
20
]
21
}],
22
23
// x axes settings
24
"xAxes": [{
25
"orientation": "top",
26
"title":{
27
"enabled": false
28
}
29
}],
30
31
// y axes settings
32
"yAxes": [{
33
"orientation": "right",
34
"title":{
35
"enabled": false
36
}
37
}],
38
39
// y scale settings
40
"yScale": {
41
"inverted": true
42
},
43
44
// chart container
45
"container": "container"
46
}
47
};
48
49
// get JSON data
50
var chart = anychart.fromJson(json);
51
52
// draw chart
53
chart.draw();
54
});