# AJAX

Lucid has an Action available to easily insert a Google Chart onto your page. Before you start with Google Charts, you should go into the Setup sheet, and insert the two 'Google Charts' script entries from the gear menu. The first entry is an insertion of the Google JSAPI, which in turn allows the the second entry to work, which loads in the Google Visualization (Charting) API. Some charts require other modules to be loaded other than the ones that Lucid brings in (corechart, geochart, gauge), and these have been left out to decrease bandwidth use. You may also remove 'geochart' or 'gauge', if you are not going to use these types of chart to further improve speed.

Once you have inserted the script header, you can put a Google Chart action into your Javascript from the 'Google' popup. To get started, choose one of the defaults from the Gear menu, such as 'Simple Pie Chart'. Now, drag from the side of the chart action to a DIV on your HTML page to put the chart into that DIV. To make the action run, you will need to either call it from another action, or create an event which calls the Chart action. An ideal event is 'ready' attached to the document, so it will run when you document is considered ready for use by the browser.