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
["2000", 1100],
6
["2001", 880],
7
["2002", 1100],
8
["2003", 1500],
9
["2004", 921],
10
["2005", 1000],
11
["2006", 1400]
12
];
13
14
// create a chart
15
var chart = anychart.cartesian();
16
17
// create a marker series and set the data
18
chart.marker(data);
19
20
// set the chart title
21
chart.title("Marker Chart: Basic Sample");
22
23
// set the titles of the axes
24
chart.xAxis().title("Year");
25
chart.yAxis().title("Sales, $");
26
27
// set the container id
28
chart.container("container");
29
30
// initiate drawing the chart
31
chart.draw();
32
});