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
// chart type
4
var chart = anychart.cartesian();
5
6
// all data
7
var data1 = anychart.data.set([
8
{"x": 2000, value: 1100},
9
{"x": 2001, value: 800},
10
{"x": 2002, value: 1100},
11
{"x": 2003, value: 1500},
12
{"x": 2004, value: 921},
13
{"x": 2005, value: 1000},
14
{"x": 2006, value: 1400}
15
]);
16
17
var data2 = anychart.data.set([
18
{"x": 2000, value: 900},
19
{"x": 2001, value: 950},
20
{"x": 2002, value: 800},
21
{"x": 2003, value: 1000},
22
{"x": 2004, value: 800},
23
{"x": 2005, value: 790},
24
{"x": 2006, value: 800}
25
]);
26
27
// set data for each series
28
series1 = chart.marker(data1);
29
series2 = chart.marker(data2);
30
31
// set colors
32
series1.fill("#00cc99", 0.5);
33
series1.stroke("#00cc99", 1, "10 5", "round");
34
series1.hoverFill("#00cc99", 0.2);
35
series1.hoverStroke("#00cc99", 2, "10 5", "round");
36
series1.selectFill("#00cc99", 0.8);
37
series1.selectStroke("#00cc99", 4, "10 5", "round");
38
39
series2.fill("none");
40
series2.hoverFill("none");
41
series2.selectFill("none");
42
series2.hatchFill("percent10");
43
series2.hoverHatchFill("percent30");
44
series2.selectHatchFill("percent50");
45
46
// Sets settings for interactivity.
47
chart.interactivity({hoverMode: "byX"});
48
49
// set marker size
50
series1.size(10);
51
series2.size(15);
52
series1.hoverSize(15);
53
series2.hoverSize(20);
54
series1.selectSize(15);
55
series2.selectSize(20);
56
57
// chart title
58
chart.title("Multi-Series Marker Chart with appearance settings configured");
59
60
// set axes titles
61
chart.xAxis().title("Years");
62
chart.yAxis().title("Sales");
63
64
// draw
65
chart.container("container");
66
chart.draw();
67
});