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
rendering.needsZero(true);
15
16
// Enable width.
17
rendering.needsWidth(true);
18
19
chart.title('Enable width for the series');
20
chart.container('container');
21
chart.draw();
22
});
23
function drawer() {
24
if (this.missing) {
25
return;
26
}
27
var shapes = this.getShapesGroup(this.pointState);
28
29
var value = this.value - this.pointWidth / 20;
30
31
shapes['stroke']
32
.moveTo(this.x, this.zero)
33
.lineTo(this.x, value - 70)
34
.lineTo(this.x + 50, value - 40)
35
.lineTo(this.x, value)
36
.lineTo(this.x + 50, value + 30)
37
.close(this.x, this.zero);
38
}