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
anychart.format.outputDateTimeFormat('dd MMMM yyyy');
3
4
var chart = anychart.candlestick();
5
6
var series = chart.candlestick([
7
{x: Date.UTC(2017, 2, 25), open: 511.53, high: 514.98, low: 505.79, close: 506.40},
8
{x: Date.UTC(2017, 2, 26), open: 507.84, high: 513.30, low: 507.23, close: 512.88},
9
{x: Date.UTC(2017, 2, 27), open: 512.36, high: 515.40, low: 510.58, close: 511.40},
10
{x: Date.UTC(2017, 2, 28), open: 515.02, high: 520.50, low: 511.47, close: 517.25}
11
]);
12
13
// Set rising fill.
14
series.risingFill(function () {
15
return this.sourceColor + ' 0.4';
16
});
17
18
var axis = chart.xAxis();
19
20
var labels = axis.labels();
21
labels.format(function() {
22
return anychart.format.dateTime(this.value);
23
});
24
25
chart.xScale().minimum(Date.UTC(2017, 2, 24)).maximum(Date.UTC(2017, 2, 29));
26
chart.title('Set rising fill parameter as a function');
27
chart.container('container');
28
chart.draw();
29
});