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
3
// set the data
4
table = anychart.data.table();
5
table.addData([
6
['2016-01-01', 1.0860],
7
['2016-01-04', 1.0832],
8
['2016-01-05', 1.078],
9
['2016-01-06', 1.0781],
10
['2016-01-07', 1.0936],
11
['2016-01-08', 1.0932],
12
['2016-01-11', 1.0860],
13
['2016-01-12', 1.0857],
14
['2016-01-13', 1.0877],
15
['2016-01-14', 1.0865],
16
['2016-01-15', 1.0917],
17
['2016-01-18', 1.0893],
18
['2016-01-19', 1.0909],
19
['2016-01-20', 1.0891],
20
['2016-01-21', 1.0874],
21
['2016-01-22', 1.0797],
22
['2016-01-25', 1.0849],
23
['2016-01-26', 1.0872],
24
['2016-01-27', 1.0893],
25
['2016-01-28', 1.0939],
26
['2016-01-29', 1.0837],
27
['2016-02-01', 1.0889],
28
['2016-02-02', 1.0919],
29
['2016-02-03', 1.1104],
30
['2016-02-04', 1.1208],
31
['2016-02-05', 1.1159],
32
['2016-02-08', 1.1198],
33
['2016-02-09', 1.1293],
34
['2016-02-10', 1.1290],
35
['2016-02-11', 1.1324],
36
['2016-02-12', 1.1260],
37
['2016-02-15', 1.1155],
38
['2016-02-16', 1.1144],
39
['2016-02-17', 1.1128],
40
['2016-02-18', 1.1107],
41
['2016-02-19', 1.1135],
42
['2016-02-22', 1.1029],
43
['2016-02-23', 1.1020],
44
['2016-02-24', 1.1013],
45
['2016-02-25', 1.1023],
46
['2016-02-26', 1.0934],
47
['2016-02-29', 1.0873]
48
]);
49
50
// map the data
51
mapping = table.mapAs();
52
mapping.addField('value', 1);
53
54
// chart type
55
var chart = anychart.stock();
56
57
// set the series
58
var series = chart.plot(0).line(mapping);
59
series.name("Euro to Dollar Rate");
60
61
chart.title('Stock Line Demo: Currency Rates');
62
63
chart.container('container');
64
chart.draw();
65
});