Google Charts - Material Line Chart

You are Here:

How to Draw a Material Line Chart?

Please wait google chart is loading...

In this example, we will draw a material line chart. Please hover the points 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: ['corechart', 'line']}); google.charts.setOnLoadCallback(drawBasic); function drawBasic() { var data = new google.visualization.DataTable(); data.addColumn('string', 'Month'); data.addColumn('number', 'Toyota'); data.addColumn('number', 'Honda'); data.addColumn('number', 'kia'); data.addRows([ ['Jan', 250, 150, 75], ['Feb', 275, 250, 175], ['Mar', 350, 315, 200], ['Apr', 325, 298, 250], ['May', 350, 300, 275] ]); var options = { chart: { title:'Total Car Sales of Toyota, Honda and Kia - 2019', }, width: 500, height: 400, hAxis: { title: 'Month' }, vAxis: { title: 'Counts' } }; var chart = new google.visualization.LineChart(document.getElementById('point')); 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