|
| | BarChart () |
| | makes an empty BarChart
|
| |
| virtual const string | getDStype () const override |
| | Get the data type.
|
| |
| void | setTitle (std::string t) |
| | Set title of the plot.
|
| |
| std::string | getTitle () const |
| | Get title of the plot.
|
| |
| void | setSubTitle (const std::string &s) |
| | set subtitle of the plot
|
| |
| std::string | getSubTitle () const |
| | get the subtitle of the plot
|
| |
| void | setValueLabel (const std::string &vAxisName) |
| | Set the label for the value axis.
|
| |
| std::string | getValueLabel () const |
| | Returns the label for the value axis.
|
| |
| void | setCategoriesLabel (const std::string &cAxisName) |
| | Change the label for category axis.
|
| |
| std::string | getCategoriesLabel () const |
| | Returns the axis label for the categories.
|
| |
| void | setBarOrientation (const std::string &orient) |
| | sets the bar chart orientation
|
| |
| std::string | getBarOrientation () const |
| | gets the bar chart orientation
|
| |
| void | setTooltipSuffix (const std::string &suffix) |
| | sets the tooltip suffix
|
| |
| std::string | getTooltipSuffix () const |
| | gets the tooltip suffix
|
| |
| void | setCategories (const std::vector< std::string > &categories) |
| | set the categories for this bar chart
|
| |
| void | addDataSeries (std::string seriesName, std::vector< double > data) |
| | Add a series of data.
|
| |
| virtual const std::string | getDataStructureRepresentation () const override |
| | get the data structure representation as a JSON
|
| |
| virtual | ~DataStructure ()=default |
| |
Support for drawing Bar charts.
Bar charts (https://en.wikipedia.org/wiki/Bar_chart) are used to represent categorical data as a series of rectangular bars with length proportional to the values they represent.
Series in a bar chart provides data for a number of categories (sometimes called bins). Categories are defined using setCategories() and the series are added using addDataSeries(). The series are rendered in the order in which they were added. Once a series has been added, it can not be modified.
One should always define the categories before adding data. Changing the categories after series have been added will throw exceptions; adding series with different number of values than the number of categories will throw an exception.
The Bar charts can have a title, subtitle. The charts can be horizontal or vertically oriented, using setBarOrientation().
A tooltip indicating the value of a series in a particular bin is displayed by hovering on a bar. One can append a string to the value using setTooltipSuffix() to specify units in the tooltip if desired.
- See also
- See tutorial on using BarChart at: https://bridgesuncc.github.io/tutorials/BarChart.html
- Author
- Matthew Mcquaigue, Kalpathi Subramanian, Erik Saule
- Date
- 09/15/24 (updated)