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 data = anychart.data.set([
8
{x: "2000", value: 1100},
9
{x: "2001", value: 880},
10
{x: "2002", value: 1100},
11
{x: "2003", value: 1500, fill: "gold", stroke: "#663399", markerSize: 15, hoverMarkerSize: 15, selectMarkerSize: 20, type: "star5"},
12
{x: "2004", value: 921},
13
{x: "2005", value: 1000},
14
{x: "2006", value: 1400}
15
]);
16
17
// set data for each series
18
series = chart.marker(data);
19
20
// Sets settings for interactivity.
21
chart.interactivity({hoverMode: "byX"});
22
23
// chart title
24
chart.title("Marker Chart with a single marker adjusted");
25
26
// set axes titles
27
chart.xAxis().title("Years");
28
chart.yAxis().title("Sales");
29
30
// draw
31
chart.container("container");
32
chart.draw();
33
});