Bridges-Python 3.5.0-dev1
Bridges(Python API)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Properties | List of all members
bridges.bar_chart.BarChart Class Reference

Support for drawing Bar charts. More...

Public Member Functions

 __init__ (self)
 
 get_data_structure_type (self)
 
None add_data_series (self, str name, list[float] values)
 Add a series of data.
 
 get_data_structure_representation (self)
 

Protected Attributes

 _c_label
 
 _v_label
 
 _title
 
 _subtitle
 
 _tt_suffix
 
 _orientation
 
 _series_data
 
 _cats
 

Properties

 title = property
 Get title of the plot.
 
 subtitle = property
 Get subtitle of the plot.
 
 value_label = property
 Get label for the value axis.
 
 categories_label = property
 Get label for the categories axis.
 
 orientation = property
 Get orientation of the bar chart.
 
 tooltip_suffix = property
 the tooltip suffix
 
 categories = property
 Get categories for this bar chart.
 

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__()

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

◆ get_data_structure_representation()

bridges.bar_chart.BarChart.get_data_structure_representation (   self)

◆ get_data_structure_type()

bridges.bar_chart.BarChart.get_data_structure_type (   self)

Member Data Documentation

◆ _c_label

bridges.bar_chart.BarChart._c_label
protected

◆ _cats

bridges.bar_chart.BarChart._cats
protected

◆ _orientation

bridges.bar_chart.BarChart._orientation
protected

◆ _series_data

bridges.bar_chart.BarChart._series_data
protected

◆ _subtitle

bridges.bar_chart.BarChart._subtitle
protected

◆ _title

bridges.bar_chart.BarChart._title
protected

◆ _tt_suffix

bridges.bar_chart.BarChart._tt_suffix
protected

◆ _v_label

bridges.bar_chart.BarChart._v_label
protected

Property Documentation

◆ categories

bridges.bar_chart.BarChart.categories = property
static

Get categories for this bar chart.

◆ categories_label

bridges.bar_chart.BarChart.categories_label = property
static

Get label for the categories axis.

◆ orientation

bridges.bar_chart.BarChart.orientation = property
static

Get orientation of the bar chart.

   Will always be either "horizontal" or "vertical"

◆ subtitle

bridges.bar_chart.BarChart.subtitle = property
static

Get subtitle of the plot.

◆ title

bridges.bar_chart.BarChart.title = property
static

Get title of the plot.

◆ tooltip_suffix

bridges.bar_chart.BarChart.tooltip_suffix = property
static

the tooltip suffix

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

◆ value_label

bridges.bar_chart.BarChart.value_label = property
static

Get label for the value axis.


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