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 a column chart
4
var chart = anychart.column([
5
{x: "Q1", value: 8},
6
{x: "Q2", value: 12},
7
{x: "Q3", value: 18},
8
{x: "Q4", value: 11}
9
]);
10
11
// set the chart width
12
chart.width("50%");
13
14
// set the chart height
15
chart.height("50%");
16
17
// specify the chart container
18
chart.container("container");
19
20
// set the chart title
21
chart.title("Width and Height — JS API");
22
23
// draw the chart
24
chart.draw();
25
26
});