Google bar chart code sample
A bar chart that is rendered as an image that uses the Google Charts API.
About this task
For more information about the Google bar chart custom visualization code sample on IBM Accelerator Catalog, see Google Bar Chart.
Google bar charts are supported as of IBM Cognos Analytics with Watson 11.1.7
This custom visualization code sample provides a way to show how to use Google charts as custom visualization inIBM Cognos Analytics with Watson. This code sample explains how to integrate a Google bar chart but similar code can be used to integrate other Google Charts.
Bar visualizations use horizontal data markers that are arranged in groups to compare individual values. You can use bar visualizations to compare discrete data or to show trends over time.
There are code samples available for developers of custom visualizations. The code samples illustrate certain aspects of the customvis library and tools. The main focus of each sample is not the completeness of the visualization, but rather to demonstrate how specific features work.
To view the source code and packed bundle (.zip file) for the Google bar chart sample, go to this public GitHub repository. To download the files, browse to the root of this directory and click Clone or download.
The method of using the Google Charts API has changed. Full details of these changes can be found here: https://github.com/IBM/ca_customvis/wiki/Known-Issues
To view the source code and packed bundle (.zip file) for the Google bar chart sample, go to this public GitHub repository. To download the files, browse to the root of this directory and click Clone or download.
For more information, see Custom visualizations code samples.
For more information about custom visualizations, see Developing custom visualizations. For an excellent tutorial to get you started, see Custom visualizations - tutorial.
- You can upload the packed bundle (.zip file).
For more information, see Packaging the custom visualization.
- You can package a sample with
customvis pack
and upload the bundle (zip file) to IBM Cognos Analytics with WatsonFor more information, see Packaging the custom visualization.
- You can run any sample locally by running
customvis start
inside the folder that contains the sample. After that, you can use the Preview Vis in IBM Cognos Analytics with Watson Dashboard or Reporting to insert the custom visualization in your dashboard or report.For more information, see Using a D3 sample in your custom visualization.
The following steps demonstrate how to use the Google bar chart visualization and populate it with data.