![]() |
Bridges-Java 3.5.0-dev1
Bridges(Java API)
|
Support for drawing Bar charts. More...
Classes | |
class | Pair |
Public Member Functions | |
BarChart () | |
Line chart default constructor. | |
String | getDataStructType () |
gets the data structure type | |
void | setTitle (String t) |
Title of the plot. | |
String | getTitle () |
Title of the plot. | |
void | setSubTitle (String s) |
Set subtitle of the plot. | |
String | getSubTitle () |
Get subtitle of the plot. | |
void | setCategoriesLabel (String cAxisName) |
Set the category axis label. | |
String | getCategoriesLabel () |
Returns the label for the category axis. | |
void | setValueLabel (String vAxisName) |
Set the label for the value axis. | |
String | getValueLabel () |
Returns the label for the vlue axis. | |
void | setBarOrientation (String orient) |
sets the bar chart orientation | |
String | getBarOrientation () |
gets the bar chart orientation | |
void | setTooltipSuffix (String suffix) |
sets the tooltip suffix | |
String | getTooltipSuffix () |
gets the tooltip suffix | |
void | setCategories (Vector< String > categories) |
set the category labels for this bar chart | |
void | addDataSeries (String seriesName, double[] data) |
Add a series of data. | |
String | getDataStructureRepresentation () |
get the data structure representation as a JSON | |
Additional Inherited Members | |
![]() | |
String | QUOTE = "\"" |
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 | ( | ) |
gets the data structure type
Reimplemented from bridges.base.DataStruct.
String bridges.base.BarChart.getDataStructureRepresentation | ( | ) |
get the data structure representation as a JSON
Reimplemented from bridges.base.DataStruct.
String bridges.base.BarChart.getSubTitle | ( | ) |
Get 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 | ) |
Set the category axis label.
cAxisName | label to show for the category axis |
void bridges.base.BarChart.setSubTitle | ( | String | s | ) |
Set 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 | ) |
Set the label for the value axis.
yaxisName | label to use for the value axis |