Bridges-Python
3.4.5-dev2-5-g352f189
Bridges(Python API)
|
Support for drawing Bar charts. More...
Public Member Functions | |
def | __init__ (self) |
def | get_data_structure_type (self) |
str | title (self) |
Title of the plot. More... | |
None | title (self, str plot_title) |
Title of the plot. More... | |
str | subtitle (self) |
Subtitle of the plot. More... | |
None | subtitle (self, str plot_sub_title) |
Subtitle of the plot. More... | |
str | value_label (self) |
Label for the value axis. More... | |
None | value_label (self, str value_label) |
Label for the value axis. More... | |
str | categories_label (self) |
Label for the categories axis. More... | |
None | categories_label (self, str c_label) |
Label for the categories axis. More... | |
str | orientation (self) |
Orientation of the bar chart. More... | |
str | orientation (self, orient) |
Sets orientation of the bar chart. More... | |
str | tooltip_suffix (self) |
the tooltip suffix More... | |
None | tooltip_suffix (self, str suffix) |
the tooltip suffix More... | |
list[str] | categories (self) |
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 | ) |
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 | ) |
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 | ) |
Orientation of the bar chart.
Will always be either "horizontal" or "vertical"
str 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 | ) |
Subtitle of the plot.
None bridges.bar_chart.BarChart.subtitle | ( | self, | |
str | plot_sub_title | ||
) |
Subtitle of the plot.
str bridges.bar_chart.BarChart.title | ( | self | ) |
Title of the plot.
None bridges.bar_chart.BarChart.title | ( | self, | |
str | plot_title | ||
) |
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 | ||
) |
the tooltip suffix
This string is appended to the values in the hover tooltip.
str bridges.bar_chart.BarChart.value_label | ( | self | ) |
Label for the value axis.
None bridges.bar_chart.BarChart.value_label | ( | self, | |
str | value_label | ||
) |
Label for the value axis.