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
// create data
4
var data = [
5
{x: "2000", value: 1100},
6
{x: "2001", value: 880},
7
{x: "2002", value: 1100},
8
{x: "2003", value: 1500,
9
normal: {
10
fill: "#b30059 0.3",
11
stroke: "#b30059",
12
markerSize: 15,
13
type: "star4"
14
},
15
hovered: {
16
fill: "#b30059 0.1",
17
stroke: "2 #b30059",
18
markerSize: 20,
19
type: "star5"
20
},
21
selected: {
22
fill: "#b30059 0.5",
23
stroke: "4 #b30059",
24
markerSize: 20,
25
type: "star6"
26
}
27
},
28
{x: "2004", value: 921},
29
{x: "2005", value: 1000},
30
{x: "2006", value: 1400}
31
];
32
33
// create a chart
34
var chart = anychart.cartesian();
35
36
// set the interactivity mode
37
chart.interactivity().hoverMode("by-x");
38
39
// create a marker series and set the data
40
series = chart.marker(data);
41
42
// set the chart title
43
chart.title("Marker Chart: Individual Points");
44
45
// set the titles of the axes
46
chart.xAxis().title("Year");
47
chart.yAxis().title("Sales, $");
48
49
// set the container id
50
chart.container("container");
51
52
// initiate drawing the chart
53
chart.draw();
54
});