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
var scale = chart.yScale();
15
// Sets scale maximum.
16
scale.maximum(2);
17
18
// add a title standalone object on the chart
19
title = anychart.standalones.title();
20
title.text("This is the title");
21
22
// put the chart on a stage and draw it
23
chart.container(stage);
24
chart.draw();
25
26
// put the title object on a stage
27
title.container(stage);
28
title.draw();
29
});