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
// create column chart
3
chart = anychart.column([
4
[1507191173976, 80540],
5
[1507292173976, 94190],
6
[1507393173976, 102610],
7
[1507494173976, 110430],
8
[1507595173976, 128000],
9
[1507696173976, 143760]
10
]);
11
12
// format the value and implicitly convert to date
13
chart.xAxis().labels().format('{%Value}{dateTimeFormat:MM-dd}');
14
15
// enable labels and explicitly specify time type
16
chart.labels().enabled(true);
17
chart.labels().format('{%x}{type:time}');
18
// explictly specify type in the title
19
chart.tooltip().titleFormat('{%x}{type:date}');
20
// use another type in the tooltip text
21
chart.tooltip().format('{%x}{type:number}');
22
23
// set container id for the chart
24
chart.container('container');
25
26
// initiate chart drawing
27
chart.draw();
28
});