Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to Use Google Charts. Using Google Charts Google Charts is used to provide a way to visualize data on your website. You can choose to use simple line.

Similar presentations


Presentation on theme: "How to Use Google Charts. Using Google Charts Google Charts is used to provide a way to visualize data on your website. You can choose to use simple line."— Presentation transcript:

1 How to Use Google Charts

2 Using Google Charts Google Charts is used to provide a way to visualize data on your website. You can choose to use simple line charts or complex hierarchical tree maps, chart types vary. The chart gallery provides a large number of ready-to-use charts for any circumstance. The most common way to use Google Charts is with JavaScript that you embed in your web page.

3 Step 1: Load the Libraries The first step to using any Google Chart is loading the Google JSAPI library loader, and then using it to load the visualization library.

4 Step 2: Preparing the Data As we all know, all charts require data. You must list the data to be charted. Google Charts require data to be wrapped in a JavaScript class called google.visualization.DataTable. This class is defined in the Google Visualization library that you loaded previously.

5 Step 3: Customizing the Chart Every Google Chart has many customizable options including: title, colors, line thickness, background fill, etc. Although the default chart appearance may look good, you should still want to customize your chart. For example, adding your own title and axis labels. Specify custom options for your chart by defining a JavaScript object with option_name/option_value properties.

6 Step 4: Drawing the Chart After you've prepared your data and options, you are ready to draw your chart. Your page must have an HTML element (typically a ) to hold your chart. You must pass your chart a reference to this element. Assign it an ID that you can use to retrieve a reference using document.getElementById(). Anything inside this element will be replaced by the chart when it is drawn. After you call draw(), your chart will be drawn on the page. You should call the draw() method every time you change the data or the options and want to update the chart.

7 Step 5: Add Interactivity Finally, the last step to your Google Chart is to add interactivity. If you want to increase your number of user clicks, you need to listen for events thrown by the chart. Here are the most common events thrown: - Ready: Thrown when the chart is drawn on the page and ready to respond to methods. - Select: Thrown when the user selects something on the chart, typically by clicking on a bar or pie slice. - Onmouseover and Onmouseout: Thrown when the user mouses over or off of a specific chart element, respectively.


Download ppt "How to Use Google Charts. Using Google Charts Google Charts is used to provide a way to visualize data on your website. You can choose to use simple line."

Similar presentations


Ads by Google