HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
// prevent premature chart script execution
2
anychart.onDocumentReady(function () {
3
// load data into the chart from a JSON file
4
anychart.data.loadJsonFile(
5
"https://raw.githubusercontent.com/Bepely/JsonExampleData/main/calendar2023.json",
6
// callback function to set chart data
7
(data) => chart.data(data)
8
);
9
10
// create a calendar chart
11
const chart = anychart.calendar();
12
13
// set the container id
14
chart.container("container");
15
16
// adjust the chart's height after drawing
17
chart.listen("chartDraw", function () {
18
document.getElementById("container").style.height =
19
chart.getActualHeight() + 5 + "px";
20
});
21
22
// draw the chart
23
chart.draw();
24
});