Google Charts – Overview ”; Previous Next Google Charts is a pure JavaScript based charting library meant to enhance web applications by adding interactive charting capability. It supports a wide range of charts. Charts are drawn using SVG in standard browsers like Chrome, Firefox, Safari, Internet Explorer(IE). In legacy IE 6, VML is used to draw the graphics. Features Following are the salient features of Google Charts library. Compatability − Works seemlessly on all major browsers and mobile platforms like android and iOS. Multitouch Support − Supports multitouch on touch screen based platforms like android and iOS. Ideal for iPhone/iPad and android based smart phones/ tablets. Free to Use − Open source and is free to use for non-commercial purpose. Lightweight − loader.js core library, is extremely lightweight library. Simple Configurations − Uses json to define various configuration of the charts and very easy to learn and use. Dynamic − Allows to modify chart even after chart generation. Multiple axes − Not restricted to x, y axis. Supports multiple axis on the charts. Configurable tooltips − Tooltip comes when a user hover over any point on a charts. googlecharts provides tooltip inbuilt formatter or callback formatter to control the tooltip programmatically. DateTime support − Handle date time specially. Provides numerous inbuilt controls over date wise categories. Print − Print chart using web page. External data − Supports loading data dynamically from server. Provides control over data using callback functions. Text Rotation − Supports rotation of labels in any direction. Supported Chart Types Google Charts library provides following types of charts − Sr.No. Chart Type & Description 1 Line Charts Used to draw line/spline based charts. 2 Area Charts Used to draw area wise charts. 3 Pie Charts Used to draw pie charts. 4 Sankey Charts, Scatter Charts, Stepped area charts, Table, Timelines, TreeMap, Trendlines Used to draw scattered charts. 5 Bubble Charts Used to draw bubble based charts. 6 Dynamic Charts Used to draw dynamic charts where user can modify charts. 7 Combinations Used to draw combinations of variety of charts. 8 3D Charts Used to draw 3D charts. 9 Angular Gauges Used to draw speedometer type charts. 10 Heat Maps Used to draw heat maps. 11 Tree Maps Used to draw tree maps. In next chapters, we”re going to discuss each type of above mentioned charts in details with examples. Licence Google Charts is open source and is free to use. Follow the link: Terms of Service. Print Page Previous Next Advertisements ”;
Category: googlecharts
Google Charts – Quick Guide
Google Charts – Quick Guide ”; Previous Next Google Charts – Overview Google Charts is a pure JavaScript based charting library meant to enhance web applications by adding interactive charting capability. It supports a wide range of charts. Charts are drawn using SVG in standard browsers like Chrome, Firefox, Safari, Internet Explorer(IE). In legacy IE 6, VML is used to draw the graphics. Features Following are the salient features of Google Charts library. Compatability − Works seemlessly on all major browsers and mobile platforms like android and iOS. Multitouch Support − Supports multitouch on touch screen based platforms like android and iOS. Ideal for iPhone/iPad and android based smart phones/ tablets. Free to Use − Open source and is free to use for non-commercial purpose. Lightweight − loader.js core library, is extremely lightweight library. Simple Configurations − Uses json to define various configuration of the charts and very easy to learn and use. Dynamic − Allows to modify chart even after chart generation. Multiple axes − Not restricted to x, y axis. Supports multiple axis on the charts. Configurable tooltips − Tooltip comes when a user hover over any point on a charts. googlecharts provides tooltip inbuilt formatter or callback formatter to control the tooltip programmatically. DateTime support − Handle date time specially. Provides numerous inbuilt controls over date wise categories. Print − Print chart using web page. External data − Supports loading data dynamically from server. Provides control over data using callback functions. Text Rotation − Supports rotation of labels in any direction. Supported Chart Types Google Charts library provides following types of charts − Sr.No. Chart Type & Description 1 Line Charts Used to draw line/spline based charts. 2 Area Charts Used to draw area wise charts. 3 Pie Charts Used to draw pie charts. 4 Sankey Charts, Scatter Charts, Stepped area charts, Table, Timelines, TreeMap, Trendlines Used to draw scattered charts. 5 Bubble Charts Used to draw bubble based charts. 6 Dynamic Charts Used to draw dynamic charts where user can modify charts. 7 Combinations Used to draw combinations of variety of charts. 8 3D Charts Used to draw 3D charts. 9 Angular Gauges Used to draw speedometer type charts. 10 Heat Maps Used to draw heat maps. 11 Tree Maps Used to draw tree maps. In next chapters, we”re going to discuss each type of above mentioned charts in details with examples. Licence Google Charts is open source and is free to use. Follow the link: Terms of Service. Google Charts – Environment Setup In this chapter we will discuss about how to set up Google Charts library to be used in web application development. Install Google Charts There are two ways to use Google Charts. Download − Download it locally from https://developers.google.com/chart and use it. CDN access − You also have access to a CDN. The CDN will give you access around the world to regional data centers that in this case, Google Chart host https://www.gstatic.com/charts. Using Downloaded Google Chart Include the googlecharts JavaScript file in the HTML page using following script − <head> <script src = “/googlecharts/loader.js”></script> </head> Using CDN We are using the CDN versions of the Google Chart library throughout this tutorial. Include the Google Chart JavaScript file in the HTML page using following script − <head> <script src = “https://www.gstatic.com/charts/loader.js”></script> </head> Google Charts – Configuration Syntax In this chapter we”ll showcase the configuration required to draw a chart using Google Chart API. Step 1: Create HTML Page Create an HTML page with the Google Chart libraries. googlecharts_configuration.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> </body> </html> Here container div is used to contain the chart drawn using Google Chart library. Here we are loading the latest version of corecharts API using google.charts.load method. Step 2: Create configurations Google Chart library uses very simple configurations using json syntax. // Instantiate and draw the chart. var chart = new google.visualization.PieChart(document.getElementById(”container”)); chart.draw(data, options); Here data represents the json data and options represents the configuration which Google Chart library uses to draw a chart withing container div using draw() method. Now we”ll configure the various parameter to create the required json string. title Configure the options of the chart. // Set chart options var options = {”title”:”Browser market shares at a specific website, 2014”, ”width”:550, ”height”:400}; DataTable Configure the data to be displayed on the chart. DataTable is a special table structured collection which contains the data of the chart. Columns of data table represents the legends and rows represents the corresponding data. addColumn() method is used to add a column where first parameter represents the data type and second parameter represents the legend. addRows() method is used to add rows accordingly. // Define the chart to be drawn. var data = new google.visualization.DataTable(); data.addColumn(”string”, ”Browser”); data.addColumn(”number”, ”Percentage”); data.addRows([ [”Firefox”, 45.0], [”IE”, 26.8], [”Chrome”, 12.8], [”Safari”, 8.5], [”Opera”, 6.2], [”Others”, 0.7] ]); Step 3: Draw the chart // Instantiate and draw the chart. var chart = new google.visualization.PieChart(document.getElementById(”container”)); chart.draw(data, options); Example Following is the complete example − googlecharts_configuration.htm Live Demo <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 = new google.visualization.DataTable(); data.addColumn(”string”, ”Browser”); data.addColumn(”number”, ”Percentage”); data.addRows([ [”Firefox”, 45.0], [”IE”, 26.8], [”Chrome”, 12.8], [”Safari”, 8.5], [”Opera”, 6.2], [”Others”, 0.7] ]); // Set chart options var options = {”title”:”Browser market shares at a specific website, 2014”, ”width”:550, ”height”:400}; // Instantiate and draw the chart. var chart = new google.visualization.PieChart(document.getElementById (”container”)); chart.draw(data, options); } google.charts.setOnLoadCallback(drawChart); </script> </body> </html> Following code call drawChart function to draws chart when Google Chart library get loaded completely. google.charts.setOnLoadCallback(drawChart); Result Verify the result. Google
Google Charts – Environment Setup ”; Previous Next In this chapter we will discuss about how to set up Google Charts library to be used in web application development. Install Google Charts There are two ways to use Google Charts. Download − Download it locally from https://developers.google.com/chart and use it. CDN access − You also have access to a CDN. The CDN will give you access around the world to regional data centers that in this case, Google Chart host https://www.gstatic.com/charts. Using Downloaded Google Chart Include the googlecharts JavaScript file in the HTML page using following script − <head> <script src = “/googlecharts/loader.js”></script> </head> Using CDN We are using the CDN versions of the Google Chart library throughout this tutorial. Include the Google Chart JavaScript file in the HTML page using following script − <head> <script src = “https://www.gstatic.com/charts/loader.js”></script> </head> Print Page Previous Next Advertisements ”;
Google Charts – Table Chart
Google Charts – Table Chart ”; Previous Next Table chart helps in rendering a table which can be sorted and paged. Table cells can be formatted using format strings, or by directly inserting HTML as cell values. Numeric values are right-aligned by default; boolean values are displayed as check marks or cross marks. Users can select single rows either with the keyboard or the mouse. Column headers can be used for sorting. The header row remains fixed during scrolling. The table fires events corresponding to user interaction. We”ve already seen the configuration used to draw this chart in Google Charts Configuration Syntax chapter. So, let”s see the complete example. Configurations We”ve used Table class to show Table based chart. //table chart var chart = new google.visualization.Table(document.getElementById(”container”)); Example googlecharts_table_chart.htm Live Demo <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: [”table”]}); </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 = new google.visualization.DataTable(); data.addColumn(”string”, ”Name”); data.addColumn(”number”, ”Salary”); data.addColumn(”boolean”, ”Full Time Employee”); data.addRows([ [”Mike”, {v: 10000, f: ”$10,000”}, true], [”Jim”, {v:8000, f: ”$8,000”}, false], [”Alice”, {v: 12500, f: ”$12,500”}, true], [”Bob”, {v: 7000, f: ”$7,000”}, true] ]); var options = { showRowNumber: true, width: ”100%”, height: ”100%” }; // Instantiate and draw the chart. var chart = new google.visualization.Table(document.getElementById(”container”)); chart.draw(data, options); } google.charts.setOnLoadCallback(drawChart); </script> </body> </html> Result Verify the result. Print Page Previous Next Advertisements ”;
Google Charts – Pie Charts
Google Charts – Pie Charts ”; Previous Next Pie charts are used to draw pie based charts. In this section we”re going to discuss following types of pie based charts. Sr.No. Chart Type & Description 1 Basic Pie Basic pie chart. 2 Donut Chart Donut Chart. 3 3D Pie chart 3D Pie chart. 4 Pie chart with exploded slices Pie chart with exploded slices. Print Page Previous Next Advertisements ”;
Stepped Area Charts
Google Charts – Stepped Area Charts ”; Previous Next A stepped area chart is a step based area chart. We”re going to discuss following types of stepped area charts. Sr.No. Chart Type & Description 1 Basic Stepped Chart Basic Stepped Area Chart. 2 Stacked Stepped Chart Stacked Stepped Area Chart. 3 100% Stacked Stepped Chart 100% Stacked Stepped Area Chart. Print Page Previous Next Advertisements ”;
Google Charts – Scatter Charts ”; Previous Next Sankey Charts, Scatter Charts, Stepped area charts, Table, Timelines, TreeMap, Trendlines are used to draw scatter based charts. In this section we”re going to discuss following types of scatter based charts. Sr.No. Chart Type & Description 1 Basic Scatter Basic scatter chart. 2 Material Scatter Chart Material Scatter Chart. 3 Dual Y Axis Scatter Chart Material Scatter Chart having dual Y-Axis. 4 Top X Axis Scatter Chart Material Scatter Chart having X-Axis on top. Print Page Previous Next Advertisements ”;
Google Charts – Useful Resources ”; Previous Next The following resources contain additional information on Google Charts. Please use them to get more in-depth knowledge on this topic. Useful Video Courses 49 Charts In Tableau Course (Latest Version) Best Seller 64 Lectures 4 hours Pavan Lalwani More Detail Excel Charts Full Course in 1 hr 3 Lectures 53 mins Thomas Fragale More Detail Learn to Create Advanced Charts in Tableau 20 Lectures 1.5 hours Harshit Srivastava More Detail Get Trading: Master Line Break Technical Analysis Charts 28 Lectures 2.5 hours Stephen Hoad More Detail A New Approach To Trading Forex and Stocks Using Renko Charts 43 Lectures 2.5 hours Stephen Hoad More Detail Excel: Data Visualization with Bar and Column Charts 14 Lectures 1 hours Mike Thomas More Detail Print Page Previous Next Advertisements ”;
Google Charts – Timelines Charts ”; Previous Next Timelines depicts how a set of resources are used over time. We”re going to discuss following types of Timelines charts. Sr.No. Chart Type / Description 1 Basic Timelines Chart Basic Timelines Chart 2 Timelines Chart with data labels Timelines Chart with data labels 3 Timelines chart without Row Label Timelines chart without Row Label 4 Timelines chart coloring Customized Timelines Chart Print Page Previous Next Advertisements ”;
Google Charts – Sankey Charts ”; Previous Next A sankey chart is a visualization tool and is used to depict a flow from one set of values to another. Connected objects are called nodes and the connections are called links. Sankeys are used to show a many-to-many mapping between two domains or multiple paths through a set of stages. Sr.No. Chart Type & Description 1 Basic Sankey Chart Basic Sankey Chart. 2 Multilevel Sankey Chart Multilevel Sankey Chart. 3 Customizing Sankey Chart Customized Sankey Chart. Print Page Previous Next Advertisements ”;