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, enable and configure markers
4
var data = [
5
{x: "January", value:10000},
6
{x: "February", value:12000, marker:{enabled:true, type:"star5", fill:"gold", size:10}},
7
{x: "March", value:13000, marker:{enabled:true, type:"star5", fill:"red", size:15}},
8
{x: "April", value:10000},
9
{x: "May", value:9000}
10
];
11
12
// set the chart type
13
var chart = anychart.line();
14
15
// create a series and set the data
16
var series = chart.line(data);
17
// set the chart title
18
19
chart.title("Markers (Points)");
20
// set the titles of the axes
21
22
var xAxis = chart.xAxis();
23
xAxis.title("Month");
24
var yAxis = chart.yAxis();
25
yAxis.title("Sales, $");
26
27
// set the container id
28
chart.container("container");
29
30
// initiate drawing the chart
31
chart.draw();
32
});