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
// set the stage
3
stage = anychart.graphics.create("container");
4
5
// create a chart
6
var chart = anychart.line();
7
8
dataSet1 = ([1.1, 1.6, 1.4, 1.9]);
9
dataSet2 = ([1, 2, 1.9, 1.3]);
10
11
series1 = chart.line(dataSet1);
12
series2 = chart.line(dataSet2);
13
14
// add a title standalone object on the chart
15
title = anychart.standalones.title();
16
title.text("This is the title");
17
18
// add a chart title
19
cTitle = chart.title("The chart title");
20
21
// put the chart on a stage and draw it
22
chart.container(stage);
23
chart.draw();
24
25
// put the title object on a stage
26
title.container(stage);
27
title.draw();
28
});