![]() |
Bridges-Python 3.5.0
Bridges(Python API)
|
Support for drawing Bar charts. More...
Public Member Functions | |
def | __init__ (self) |
def | get_data_structure_type (self) |
str | title (self) |
Get title of the plot. More... | |
None | title (self, str plot_title) |
Set title of the plot. More... | |
str | subtitle (self) |
Get subtitle of the plot. More... | |
None | subtitle (self, str plot_sub_title) |
Set subtitle of the plot. More... | |
str | value_label (self) |
Get label for the value axis. More... | |
None | value_label (self, str value_label) |
Set label for the value axis. More... | |
str | categories_label (self) |
Get label for the categories axis. More... | |
None | categories_label (self, str c_label) |
Label for the categories axis. More... | |
str | orientation (self) |
Get orientation of the bar chart. More... | |
None | orientation (self, orient) |
Sets orientation of the bar chart. More... | |
str | tooltip_suffix (self) |
the tooltip suffix More... | |
None | tooltip_suffix (self, str suffix) |
Set the tooltip suffix. More... | |
list[str] | categories (self) |
Get categories for this bar chart. More... | |
None | categories (self, list[str] series_bins) |
Set the categories for the bar chart. More... | |
None | add_data_series (self, str name, list[float] values) |
Add a series of data. More... | |
def | get_data_structure_representation (self) |
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 BarChart.categories and the series are added using BarChart.add_data_series(). 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 BarChart.orientation.
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 barchart.tooltip_suffix to specify units in the tooltip if desired.
def bridges.bar_chart.BarChart.__init__ | ( | self | ) |
None bridges.bar_chart.BarChart.add_data_series | ( | self, | |
str | name, | ||
list[float] | values | ||
) |
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.
name indicates the name of the data to add values values of that serie for each category
list[str] bridges.bar_chart.BarChart.categories | ( | self | ) |
Get categories for this bar chart.
None bridges.bar_chart.BarChart.categories | ( | self, | |
list[str] | series_bins | ||
) |
Set the categories for the bar chart.
will throw an exception if there are already data series defined.
str bridges.bar_chart.BarChart.categories_label | ( | self | ) |
Get label for the categories axis.
None bridges.bar_chart.BarChart.categories_label | ( | self, | |
str | c_label | ||
) |
Label for the categories axis.
def bridges.bar_chart.BarChart.get_data_structure_representation | ( | self | ) |
def bridges.bar_chart.BarChart.get_data_structure_type | ( | self | ) |
str bridges.bar_chart.BarChart.orientation | ( | self | ) |
Get orientation of the bar chart.
Will always be either "horizontal" or "vertical"
None bridges.bar_chart.BarChart.orientation | ( | self, | |
orient | |||
) |
Sets orientation of the bar chart.
Must be either "horizontal" or "vertical". Will throw an exception otherwise.
str bridges.bar_chart.BarChart.subtitle | ( | self | ) |
Get subtitle of the plot.
None bridges.bar_chart.BarChart.subtitle | ( | self, | |
str | plot_sub_title | ||
) |
Set subtitle of the plot.
str bridges.bar_chart.BarChart.title | ( | self | ) |
Get title of the plot.
None bridges.bar_chart.BarChart.title | ( | self, | |
str | plot_title | ||
) |
Set title of the plot.
str bridges.bar_chart.BarChart.tooltip_suffix | ( | self | ) |
the tooltip suffix
This string is appended to the values in the hover tooltip.
None bridges.bar_chart.BarChart.tooltip_suffix | ( | self, | |
str | suffix | ||
) |
Set the tooltip suffix.
This string is appended to the values in the hover tooltip.
str bridges.bar_chart.BarChart.value_label | ( | self | ) |
Get label for the value axis.
None bridges.bar_chart.BarChart.value_label | ( | self, | |
str | value_label | ||
) |
Set label for the value axis.