
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to add Google Charts to your web page?
To add Google Charts to your web page, the code is as follows −
Example
<!DOCTYPE html> <html> <head> <title>Google Charts Tutorial</title> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load("current", { packages: ["corechart"] }); </script> <style> .barchartContainer { width: 550px; height: 400px; margin: 0 auto; font-weight: bold; } body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } </style> </head> <body> <h1 style="text-align: center;"> Adding google charts to your web page Example </h1> <div class="barchartContainer"></div> <script language="JavaScript"> function drawChart() { var data = google.visualization.arrayToDataTable([ ["Year", "India"], ["2013", 500], ["2014", 800], ["2015", 1000], ["2016", 1200], ["2017", 1400] ]); var options = { title: "Educated people(in millions)" }; var chart = new google.visualization.BarChart( document.querySelector(".barchartContainer") ); chart.draw(data, options); } google.charts.setOnLoadCallback(drawChart); </script> </body> </html>
Output
The above code will produce the following output −
- Related Articles
- How to use Google Fonts on your web page?
- How to add background music to your web page?
- How to add Scalable Vector Graphics (SVG) to your Web Page?
- How To Add Google Translate Button On Your Webpage?
- How to add Google map inside html page without using API key?
- How to add an image as background image of a web page?
- How to Add Legends to charts in Python?
- How to automatically redirect a Web Page to another URL?
- How to automatically transfer visitors to a new web page?
- How to completely fill web page with HTML canvas?
- How to Add Google Maps to a Website?
- How to add YouTube video to Google slides?
- How to add group labels for bar charts in Matplotlib?
- How to add video in HTML page?
- Coolnovo a web browser similar to google chrome

Advertisements