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
var json = {
3
// chart settings
4
"chart": {
5
// chart type
6
"type": "column",
7
// chart title
8
"title": "JSON Visual Settings",
9
// series settings
10
"series": [{
11
// series data
12
"data": [
13
{"x": "P1", "value": "128.14"},
14
{"x": "P2", "value": "112.61"},
15
{"x": "P3", "value": "163.21"},
16
{"x": "P4", "value": "229.98"},
17
{"x": "P5", "value": "90.54"},
18
{"x": "P6", "value": "104.19"},
19
{"x": "P7", "value": "150.67"},
20
{"x": "P8", "value": "120.43"},
21
{"x": "P9", "value": "143.76"},
22
{"x": "P10", "value": "191.34"},
23
{"x": "P11", "value": "134.17"},
24
{"x": "P12", "value": "145.72"},
25
{"x": "P13", "value": "222.56"},
26
{"x": "P14", "value": "187.12"},
27
{"x": "P15", "value": "154.32"},
28
{"x": "P16", "value": "133.08"}
29
],
30
31
// series fill color
32
"fill":"gold",
33
// series border color
34
"stroke": "gray",
35
// border color on mouse over
36
"hoverStroke": "darkred",
37
// hatch fill settings
38
"hatchFill": {
39
// hatch fill type
40
"type": "diagonalbrick",
41
// hatch fill color
42
"color": "gray"
43
},
44
// settings of the hatch fill on mouse over
45
"hoverHatchFill":{
46
// hatch fill type
47
"type": "diagonalbrick",
48
// hatch fill color
49
"color": "darkred"
50
}
51
52
}],
53
// chart container
54
"container": "container"
55
}
56
};
57
var chart = anychart.fromJson(json);
58
chart.draw();
59
});