Bridges-Java
3.4.4-dev2-4-g23cf54b
Bridges(Java API)
|
Support for drawing Bar charts. More...
Classes | |
class | Pair |
Public Member Functions | |
BarChart () | |
Line chart default constructor. More... | |
String | getDataStructType () |
gets the data type More... | |
void | setTitle (String t) |
Title of the plot. More... | |
String | getTitle () |
Title of the plot. More... | |
void | setSubTitle (String s) |
Subtitle of the plot. More... | |
String | getSubTitle () |
Subtitle of the plot. More... | |
void | setCategoriesLabel (String cAxisName) |
Change the category axis label. More... | |
String | getCategoriesLabel () |
Returns the label for the category axis. More... | |
void | setValueLabel (String vAxisName) |
Change the label for the value axis. More... | |
String | getValueLabel () |
Returns the label for the vlue axis. More... | |
void | setBarOrientation (String orient) |
sets the bar chart orientation More... | |
String | getBarOrientation () |
gets the bar chart orientation More... | |
void | setTooltipSuffix (String suffix) |
sets the tooltip suffix More... | |
String | getTooltipSuffix () |
gets the tooltip suffix More... | |
void | setCategories (Vector< String > categories) |
set the category labels for this bar chart More... | |
void | addDataSeries (String seriesName, double[] data) |
Add a series of data. More... | |
String | getDataStructureRepresentation () |
get the data structure representation as a JSON More... | |
Additional Inherited Members | |
Protected Attributes inherited from bridges.base.DataStruct | |
String | QUOTE = "\"" |
Package Attributes inherited from bridges.base.DataStruct | |
String | COMMA = "," |
String | COLON = ":" |
String | OPEN_CURLY = "{" |
String | CLOSE_CURLY = "}" |
String | OPEN_PAREN = "(" |
String | CLOSE_PAREN = ")" |
String | OPEN_BOX = "[" |
String | CLOSE_BOX = "]" |
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.
bridges.base.BarChart.BarChart | ( | ) |
Line chart default constructor.
void bridges.base.BarChart.addDataSeries | ( | String | seriesName, |
double[] | data | ||
) |
Add a series of data.
This will throw an exception if the data vector does not have the same size as the number of categories.
This will throw exceptions if two series have the same name.
seriesName | indicates the name of the data to add |
data | values of that serie for each category |
String bridges.base.BarChart.getBarOrientation | ( | ) |
gets the bar chart orientation
String bridges.base.BarChart.getCategoriesLabel | ( | ) |
Returns the label for the category axis.
String bridges.base.BarChart.getDataStructType | ( | ) |
String bridges.base.BarChart.getDataStructureRepresentation | ( | ) |
get the data structure representation as a JSON
Reimplemented from bridges.base.DataStruct.
String bridges.base.BarChart.getSubTitle | ( | ) |
Subtitle of the plot.
String bridges.base.BarChart.getTitle | ( | ) |
Title of the plot.
String bridges.base.BarChart.getTooltipSuffix | ( | ) |
gets the tooltip suffix
String bridges.base.BarChart.getValueLabel | ( | ) |
Returns the label for the vlue axis.
void bridges.base.BarChart.setBarOrientation | ( | String | orient | ) |
sets the bar chart orientation
Bar charts can be "horizontal" or "vertical". Throws exception on other values.
orient |
void bridges.base.BarChart.setCategories | ( | Vector< String > | categories | ) |
set the category labels for this bar chart
Will throw an exception if there are already data series defined.
categories | the name of each category |
void bridges.base.BarChart.setCategoriesLabel | ( | String | cAxisName | ) |
Change the category axis label.
cAxisName | label to show for the category axis |
void bridges.base.BarChart.setSubTitle | ( | String | s | ) |
Subtitle of the plot.
s | the subtitle to be shown |
void bridges.base.BarChart.setTitle | ( | String | t | ) |
Title of the plot.
t | the title to be shown |
void bridges.base.BarChart.setTooltipSuffix | ( | String | suffix | ) |
sets the tooltip suffix
This appends a string to the values in the hover tooltip.
suffix |
void bridges.base.BarChart.setValueLabel | ( | String | vAxisName | ) |
Change the label for the value axis.
yaxisName | label to use for the value axis |