Skip to content

Chart

class Chart()

Represents a chart with metadata from matplotlib.

Attributes:

  • type ChartType - The type of chart
  • title str - The title of the chart
  • elements List[Any] - The elements of the chart
  • png Optional[str] - The PNG representation of the chart encoded in base64

ChartType

class ChartType(str, Enum)

Chart types

Enum Members:

  • LINE (“line”)
  • SCATTER (“scatter”)
  • BAR (“bar”)
  • PIE (“pie”)
  • BOX_AND_WHISKER (“box_and_whisker”)
  • COMPOSITE_CHART (“composite_chart”)
  • UNKNOWN (“unknown”)

Chart2D

class Chart2D(Chart)

Represents a 2D chart with metadata.

Attributes:

  • x_label Optional[str] - The label of the x-axis
  • y_label Optional[str] - The label of the y-axis

PointData

class PointData()

Represents a point in a 2D chart.

Attributes:

  • label str - The label of the point
  • points List[Tuple[Union[str, float], Union[str, float]]] - The points of the chart

PointChart

class PointChart(Chart2D)

Represents a point chart with metadata.

Attributes:

  • x_ticks List[Union[str, float]] - The ticks of the x-axis
  • x_tick_labels List[str] - The labels of the x-axis
  • x_scale str - The scale of the x-axis
  • y_ticks List[Union[str, float]] - The ticks of the y-axis
  • y_tick_labels List[str] - The labels of the y-axis
  • y_scale str - The scale of the y-axis
  • elements List[PointData] - The points of the chart

LineChart

class LineChart(PointChart)

Represents a line chart with metadata.

Attributes:

  • type ChartType - The type of chart

ScatterChart

class ScatterChart(PointChart)

Represents a scatter chart with metadata.

Attributes:

  • type ChartType - The type of chart

BarData

class BarData()

Represents a bar in a bar chart.

Attributes:

  • label str - The label of the bar
  • group str - The group of the bar
  • value str - The value of the bar

BarChart

class BarChart(Chart2D)

Represents a bar chart with metadata.

Attributes:

  • type ChartType - The type of chart
  • elements List[BarData] - The bars of the chart

PieData

class PieData()

Represents a pie slice in a pie chart.

Attributes:

  • label str - The label of the pie slice
  • angle float - The angle of the pie slice
  • radius float - The radius of the pie slice
  • autopct float - The autopct value of the pie slice

PieChart

class PieChart(Chart)

Represents a pie chart with metadata.

Attributes:

  • type ChartType - The type of chart
  • elements List[PieData] - The pie slices of the chart

BoxAndWhiskerData

class BoxAndWhiskerData()

Represents a box and whisker in a box and whisker chart.

Attributes:

  • label str - The label of the box and whisker
  • min float - The minimum value of the box and whisker
  • first_quartile float - The first quartile of the box and whisker
  • median float - The median of the box and whisker
  • third_quartile float - The third quartile of the box and whisker
  • max float - The maximum value of the box and whisker
  • outliers List[float] - The outliers of the box and whisker

BoxAndWhiskerChart

class BoxAndWhiskerChart(Chart2D)

Represents a box and whisker chart with metadata.

Attributes:

  • type ChartType - The type of chart
  • elements List[BoxAndWhiskerData] - The box and whiskers of the chart

CompositeChart

class CompositeChart(Chart)

Represents a composite chart with metadata. A composite chart is a chart that contains multiple charts (subplots).

Attributes:

  • type ChartType - The type of chart
  • elements List[Chart] - The charts (subplots) of the composite chart