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', 29, 1217],
7
['2004-01-05', 38, 3885],
8
['2004-01-06', 43, 992],
9
['2004-01-07', 48, 1753],
10
['2004-01-08', 61, 2493],
11
['2004-01-09', 68, 5672],
12
['2004-01-12', 52, 7284],
13
['2004-01-13', 56, 2737],
14
['2004-01-14', 42, 8338],
15
['2004-01-15', 46, 4829],
16
['2004-01-16', 91, 7532],
17
['2004-01-20', 62, 10387],
18
['2004-01-21', 54, 3832],
19
['2004-01-22', 43, 9248],
20
['2004-01-23', 59, 2487],
21
['2004-01-26', 42, 2498],
22
['2004-01-27', 49, 7564],
23
['2004-01-28', 49, 5764],
24
['2004-01-29', 86, 3549],
25
['2004-01-30', 71, 7365],
26
['2004-02-02', 81, 2985],
27
['2004-02-03', 81, 3573],
28
['2004-02-04', 90, 9834],
29
['2004-02-05', 10, 3453],
30
['2004-02-06', 74, 7843],
31
['2004-02-09', 52, 3820],
32
['2004-02-10', 39, 2374],
33
['2004-02-11', 87, 9458],
34
['2004-02-12', 48, 8237],
35
['2004-02-13', 43, 9283],
36
['2004-02-17', 37, 2234]
37
]);
38
39
// map the data
40
mapping_total = table.mapAs();
41
mapping_total.addField('value', 1);
42
mapping_region = table.mapAs();
43
mapping_region.addField('value', 2);
44
45
// chart type
46
var chart = anychart.stock();
47
48
// set the series
49
var series_total = chart.plot(0).jumpLine(mapping_total);
50
series_total.name("Total Request number");
51
var series_region = chart.plot(1).jumpLine(mapping_region);
52
series_region.name("Region Request Number");
53
54
// coloring
55
series_total.stroke("#ff0000");
56
57
chart.title('Stock Jump Line Demo');
58
59
chart.container('container');
60
chart.draw();
61
});