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
['2004-01-02', 20],
7
['2004-01-05', 30],
8
['2004-01-06', 40],
9
['2004-01-07', 40],
10
['2004-01-08', 60],
11
['2004-01-09', 60],
12
['2004-01-12', 50],
13
['2004-01-13', 50],
14
['2004-01-14', 40],
15
['2004-01-15', 40],
16
['2004-01-16', 90],
17
['2004-01-20', 60],
18
['2004-01-21', 50],
19
['2004-01-22', 40],
20
['2004-01-23', 50],
21
['2004-01-26', 40],
22
['2004-01-27', 40],
23
['2004-01-28', 40],
24
['2004-01-29', 84],
25
['2004-01-30', 74],
26
['2004-02-02', 80],
27
['2004-02-03', 80],
28
['2004-02-04', 92],
29
['2004-02-05', 100],
30
['2004-02-06', 74],
31
['2004-02-09', 50],
32
['2004-02-10', 30],
33
['2004-02-11', 86],
34
['2004-02-12', 40],
35
['2004-02-13', 40],
36
['2004-02-17', 30]
37
]);
38
39
// map the data
40
mapping = table.mapAs();
41
mapping.addField('value', 1);
42
43
// chart type
44
var chart = anychart.stock();
45
46
// set the series
47
var series = chart.plot(0).jumpLine(mapping);
48
series.name("Total Request Number");
49
50
chart.title('Stock JumpLine Demo');
51
52
chart.container('container');
53
chart.draw();
54
});