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 chart = anychart.column();
3
4
var series = chart.line([
5
{x: 'January', value: 2},
6
{x: 'February', value: 5},
7
{x: 'March', value: 3},
8
{x: 'April', value: 6},
9
{x: 'May', value: 4}
10
]);
11
12
var rendering = series.rendering();
13
rendering.point(drawer);
14
15
// Enable zero value.
16
rendering.needsZero(true);
17
18
chart.title('Enable zero value for the series');
19
chart.container('container');
20
chart.draw();
21
});
22
function drawer() {
23
if (this.missing) {
24
return;
25
}
26
var shapes = this.getShapesGroup(this.pointState);
27
28
shapes['stroke']
29
.moveTo(this.x, this.zero)
30
.lineTo(this.x, this.value - 70)
31
.lineTo(this.x + 50, this.value - 40)
32
.lineTo(this.x, this.value)
33
.lineTo(this.x + 50, this.value + 30)
34
.close(this.x, this.zero);
35
}