Bar Chart Tutorial

BRIDGES provides a basic set of bar charts for plotting information based on category grouping.

First one defines the category groupings with setCategories(). One can label the category axis with setCategoriesLabel(). When hovering on a bar, a tooltip will appear and one can add units to the values by using setTooltipSuffix().

One can have a single series of data to make a standard bar chart or multiple series of data to make a clustered bar chart. One specifies a data serie using addDataSeries() which takes the name of the series and an array of floats which provide the value of that serie for each of the category.

The BarChart can have a title (see getTitle() and setTitle()) and a subtitle (see setSubTitle() and getSubTitle()). The bars can be either vertical bars or horizontal bars using setBarOrientation()

This tutorial will illustrate the use of bar charts to display some population information (which is made up).

See also

See complete documentation of bar charts for C++, Java , or Python

Code Example

Here is the code for this tutorial. The expected visualization follows that.

Java
C++
Python

If you follow the URL given to you when the application runs, it will get to to the Bridges webpage that shows your output (also shown below). You do not need to be logged into your BRIDGES account to see the output. If you are logged into your account, the output will show up in your gallery.