Google Charts - Basic Calendar Chart

You are Here:

How to Draw a Basic Calendar Chart?

Please wait google chart is loading...

In this example, we will draw a basic calendar chart. Please hover the boxes in the above chart to view particular details.

Example

HTML Online Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://www.gstatic.com/charts/loader.js"></script> </head> <body> <div id="point"> </div> <script> google.charts.load("current", {packages:["calendar"]}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = new google.visualization.DataTable(); data.addColumn({ type: 'date', id: 'Date' }); data.addColumn({ type: 'number', id: 'Date' }); data.addRows([ [ new Date(2019, 2, 1), 13 ], [ new Date(2019, 2, 5), 14 ], [ new Date(2019, 2, 9), 15 ], [ new Date(2019, 2, 17), 16 ], [ new Date(2019, 2, 24), 17 ], // Many rows omitted for brevity. [ new Date(2020, 3, 4), 4 ], [ new Date(2020, 3, 5), 5 ], [ new Date(2020, 3, 12), 12 ], [ new Date(2020, 3, 13), 13 ], [ new Date(2020, 3, 19), 19 ], [ new Date(2020, 3, 23), 23 ], [ new Date(2020, 3, 24), 24 ], [ new Date(2020, 3, 30), 30 ] ]); var chart = new google.visualization.Calendar(document.getElementById('point')); var options = { title: "Public Holidays", height: 400, }; chart.draw(data, options); } </script> </body> </html>

Reminder

Hi Developers, we almost covered 98% of Google Charts Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in Google Charts.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author