Google Chart API Example Snippet
In this snippet, we will give an example of how to use the Google Chart API to display a chart on your Virtual Ticket form
Note: This solution is optimized for Virtual Ticket Developer.
If you are using Workgroups DaVinci and are planning to use a Toolbox snippet not marked as DaVinci-compatible, please check with Support for possible compatibility issues before using.
With the use of the Google Chart API, we can insert dynamic graphs or charts into our Virtual Ticket forms. First off, it's best to start with the Chart Wizard provided by Google. With some configuration, you can create a URL:
This URL will display an image similar to the following:
If we look at the URL, all sections indicated by red and blue are parameters and values. Because the remainder of the graph was configured by us using the Chart Wizard, the parameter we are most interested in (and want to be dynamic) is the chd parameter. In this case, we have our x-values listed first (1,2,3,4,5,6,7,8,9,10,11,12,13,14), a separator (|), then our y-values (40,43,20,25,25,34,52,12,23,46,32,53,28,19). With a query, we can recreate our data set and concatenate the portions together to dynamically create our graph. We can then use the Professional Services Library function PS.SetWebImage to set the graph to a box on our form. Here's an example:
Use this format to create your own charts and graphs.