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.column([
5
{x: 0, open: 611, value: 214},
6
{x: 1, open: 606, value: 413},
7
{x: 2, open: 612, value: 315},
8
{x: 3, open: 611, value: 500}
9
]);
10
11
var rendering = series.rendering();
12
rendering.point(drawer);
13
14
// Set Y values.
15
rendering.yValues(['open', 'value']);
16
17
chart.title('Set Y values');
18
chart.container('container');
19
chart.draw();
20
});
21
function drawer() {
22
if (this.missing) {
23
return;
24
}
25
var shapes = this.getShapesGroup(this.pointState);
26
27
var leftX = this.x - this.pointWidth / 2;
28
var rightX = leftX + this.pointWidth;
29
30
shapes['path']
31
.moveTo(leftX, this.zero)
32
.lineTo(this.x, this.value)
33
.lineTo(rightX, this.zero)
34
.close();
35
}