Bridges-Python 3.5.0
Bridges(Python API)
Public Member Functions | List of all members
bridges.bar_chart.BarChart Class Reference

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)
 

Detailed Description

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.

See also
See tutorial on using BarChart at: https://bridgesuncc.github.io/tutorials/BarChart.html

Constructor & Destructor Documentation

◆ __init__()

def bridges.bar_chart.BarChart.__init__ (   self)

Member Function Documentation

◆ add_data_series()

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

◆ categories() [1/2]

list[str] bridges.bar_chart.BarChart.categories (   self)

Get categories for this bar chart.

◆ categories() [2/2]

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.

◆ categories_label() [1/2]

str bridges.bar_chart.BarChart.categories_label (   self)

Get label for the categories axis.

◆ categories_label() [2/2]

None bridges.bar_chart.BarChart.categories_label (   self,
str  c_label 
)

Label for the categories axis.

◆ get_data_structure_representation()

def bridges.bar_chart.BarChart.get_data_structure_representation (   self)

◆ get_data_structure_type()

def bridges.bar_chart.BarChart.get_data_structure_type (   self)

◆ orientation() [1/2]

str bridges.bar_chart.BarChart.orientation (   self)

Get orientation of the bar chart.

   Will always be either "horizontal" or "vertical"

◆ orientation() [2/2]

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.

◆ subtitle() [1/2]

str bridges.bar_chart.BarChart.subtitle (   self)

Get subtitle of the plot.

◆ subtitle() [2/2]

None bridges.bar_chart.BarChart.subtitle (   self,
str  plot_sub_title 
)

Set subtitle of the plot.

◆ title() [1/2]

str bridges.bar_chart.BarChart.title (   self)

Get title of the plot.

◆ title() [2/2]

None bridges.bar_chart.BarChart.title (   self,
str  plot_title 
)

Set title of the plot.

◆ tooltip_suffix() [1/2]

str bridges.bar_chart.BarChart.tooltip_suffix (   self)

the tooltip suffix

   This string is appended to the values in the hover tooltip.

◆ tooltip_suffix() [2/2]

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.

◆ value_label() [1/2]

str bridges.bar_chart.BarChart.value_label (   self)

Get label for the value axis.

◆ value_label() [2/2]

None bridges.bar_chart.BarChart.value_label (   self,
str  value_label 
)

Set label for the value axis.


The documentation for this class was generated from the following file: