Nav view search

Navigation

Search

MetaCommunications Blog

Product features, trending technologies and general updates from our team

Back

Using the Google Chart API to Show Charts in Virtual Ticket

By Ken Valley on 2011-12-15

Bookmark and Share Share

Building on my article from last time, generating QR codes, we can use the Google Chart API to create and show graphs or charts in our Virtual Ticket forms.
Using the Google Chart API to Show Charts in Virtual Ticket

Read Increase the Quick Response in Your Life for more information on QR codes and Virtual Ticket.

Data can be queried from a Virtual Ticket system and sent to the Google Chart API through a URL. The chart API then uses the data in the URL to generate and send back a chart image that can be used in Virtual Ticket forms. This provides a quick, visual way to communicate important information to users and clients. 

Some common examples for using the chart API could include showing the past six months sales in a line graph, displaying total sales for individual departments in a pie chart, showing percentage of sales by region in a map graph or charting open jobs over the last month in a bar graph. Any information that can be expressed in one of Google’s charts can be displayed on a Virtual Ticket form.

To display the chart in Virtual Ticket, you will first need to create a graph or chart using the chart wizard Google provides. This will generate a URL that points to an image of the chart that you created using the chart API. You can then use the Professional Services Library function PS.SetWebImage to load the URL into a Virtual Ticket form. There are no limits to how many calls can be made to the Google Chart API.

The chart you created uses static values that are displayed directly in the URL. However, you could replace the values in the URL with a database query to load dynamic values into the chart. This way, the chart will automatically change based on the query. Every time someone opens the Virtual Ticket form, the chart (or charts) will be up-to-date.

Google Chart API Example Snippet gives more information about how the chart API URL works.

In addition to line graphs, you can also generate bar graphs, radar graphs, point graphs, pie charts, as well as mapping charts.

Can you think of some uses for the chart API?  Let us know how you used it!

blog comments powered by Disqus