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
// data
3
data = [
4
["A", 637166],
5
["B", 721630],
6
["C", 148662],
7
["D", 78662],
8
["E", 90000]
9
];
10
11
// creat a chart
12
var chart = anychart.column();
13
14
// enable grid
15
chart.yGrid(true);
16
// set grid stroke appearance
17
chart.yGrid().stroke({color: "#FFF",dash: "3 5"});
18
19
// enable grid
20
chart.xGrid(true);
21
// set grid stroke appearance
22
chart.xGrid().stroke({color: "#FFF",dash: "3 5"});
23
24
// chart title
25
chart.title("Custom Grid Stroke");
26
27
// set background gradient
28
chart.background().fill({keys: ["#BB0000", "#440000"],angle: 45});
29
30
// configure series
31
var series = chart.column(data);
32
series.stroke("#FFF");
33
series.fill("#FF0 0.85");
34
35
// adjust y axis
36
chart.yAxis().stroke("white");
37
chart.yAxis().ticks(false);
38
chart.yAxis().labels().fontColor("white");
39
40
// adjust x axis
41
chart.xAxis().stroke("white");
42
chart.xAxis().labels().fontColor("white");
43
44
// display chart
45
chart.container("container");
46
chart.draw();
47
});