
- Google Charts Tutorial
- Google Charts - Home
- Google Charts - Overview
- Google Charts - Environment Setup
- Configuration Syntax
- Google Charts - Area Charts
- Google Charts - Bar Charts
- Google Charts - Bubble Charts
- Google Charts - Calendar Charts
- Google Charts - Candlestick Charts
- Google Charts - Column Charts
- Google Charts - Combination Chart
- Google Charts - Histogram Charts
- Google Charts - Line Charts
- Google Charts - Maps
- Google Charts - Organization Chart
- Google Charts - Pie Charts
- Google Charts - Sankey Charts
- Google Charts - Scatter Charts
- Stepped Area Charts
- Google Charts - Table Chart
- Google Charts - Timeline Charts
- Google Charts - TreeMap Chart
- Google Charts - Trendline Charts
- Google Charts Useful Resources
- Google Charts - Quick Guide
- Google Charts - Useful Resources
- Google Charts - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Histogram Chart Multiple Series
Following is an example of a histogram chart with multiple series. We've already seen the configuration used to draw this chart in Google Charts Configuration Syntax chapter. So, let's see the complete example.
Example
googlecharts_histogram_multiple.htm
<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> </head> <body> <div id = "container" style = "width: 550px; height: 400px; margin: 0 auto"> </div> <script language = "JavaScript"> function drawChart() { // Define the chart to be drawn. var data = google.visualization.arrayToDataTable([ ['Student Roll No', 'Height', 'Weight'], ['1', 80, 40],['2', 55, 30],['3', 68, 34],['4', 80, 40],['5', 54, 27], ['6', 70, 35],['7', 85, 42],['8', 78, 40],['9', 70, 35],['10', 58, 28], ['11', 90, 45],['12', 65, 33],['13', 88, 50],['14', 82, 41],['15', 65, 30], ['16', 86, 43],['17', 45, 30],['18', 62, 30],['19', 84, 42],['20', 75, 40], ['21', 82, 41],['22', 75, 40],['23', 58, 30],['24', 70, 35],['25', 85, 40] ]); // Set chart options var options = { title: 'Students Height and Weight', legend: { position: 'bottom' } }; // Instantiate and draw the chart. var chart = new google.visualization.Histogram(document.getElementById('container')); chart.draw(data, options); } google.charts.setOnLoadCallback(drawChart); </script> </body> </html>
Result
Verify the result.
googlecharts_histogram_charts.htm
Advertisements