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.ohlc([
3
{x: new Date('28-Aug-07'), open: 511.53, high: 514.98, low: 505.79, close: 506.40},
4
{x: new Date('29-Aug-07'), open: 507.84, high: 513.30, low: 507.23, close: 512.88},
5
{x: new Date('30-Aug-07'), open: 512.36, high: 515.40, low: 510.58, close: 511.40},
6
{x: new Date('31-Aug-07'), open: 513.10, high: 516.50, low: 511.47, close: 515.25},
7
{x: new Date('01-Sep-07'), open: 515.02, high: 528.00, low: 514.62, close: 525.15}
8
]);
9
10
var scale = chart.xScale();
11
scale.alignMinimum(true);
12
scale.alignMaximum(true);
13
14
chart.xAxis({ticks: true});
15
chart.container('container');
16
chart.draw();
17
18
var ticks = scale.ticks();
19
20
// Get interval unit count.
21
var getIntervalUnitCount = ticks.getIntervalUnitCount();
22
23
chart.title('Interval unit count is ' + getIntervalUnitCount);
24
});