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