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
// chart type
4
var chart = anychart.column();
5
6
// adjust grid
7
var grid = chart.grid();
8
// enable grid
9
grid.enabled(true);
10
// set grid's stroke appearance
11
grid.stroke({
12
// set stroke color
13
color: "#FFF",
14
// set dashes and gaps length
15
dash: "3 5"
16
});
17
18
// set y ticks interval
19
var yTicks = chart.yScale().ticks();
20
yTicks.interval(100000);
21
22
var title = chart.title();
23
title.enabled(true);
24
title.fontColor("#FFF");
25
title.text("Custom Grid Stroke");
26
27
// set background color
28
var background = chart.background();
29
background.fill({
30
// set colors position
31
keys: ["#BB0000", "#440000"],
32
// set angle of colors drawing
33
angle: 45
34
});
35
36
var series = chart.column([
37
["A", 637166],
38
["B", 721630],
39
["C", 148662],
40
["D", 78662],
41
["E", 90000]
42
]);
43
// disable series tooltip
44
series.tooltip(false);
45
// set chart stroke
46
series.stroke("#FFF");
47
// set series inner color
48
series.fill("#FF0 0.85");
49
50
// adjust y axis
51
var yAxis = chart.yAxis();
52
yAxis.stroke("white");
53
yAxis.ticks(false);
54
var yLabels = chart.yAxis().labels();
55
yLabels.fontColor("white");
56
// adjust x axis
57
var xAxis = chart.xAxis();
58
xAxis.stroke("white");
59
var xLabels = chart.xAxis().labels();
60
xLabels.fontColor("white");
61
62
// draw
63
chart.container("container");
64
chart.draw();
65
});