graphical.chart
LabelChartRenderer
Renderer for labeled charts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
The title of the chart rendered at the top. |
required |
ticks
|
Tuple[float, float]
|
Minimum and maximum value to display on the x-axis. |
None
|
box
|
Box
|
One of the constants in rich.box used to draw the edges. |
HEAVY
|
Source code in src/graphical/chart.py
add_row(content, content_width, label='')
Add row to chart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
Union[RenderableType, Segment]
|
RenderableType representing the content. |
required |
content_width
|
int
|
Width of the content. |
required |
label
|
str
|
Label of the content line. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
LabelChartRow |
LabelChartRow
|
Row created and added to LabelChartRenderer. |
Source code in src/graphical/chart.py
render()
Render the labeled chart.
Returns:
| Name | Type | Description |
|---|---|---|
RenderResult |
RenderResult
|
Rendered chart. |
Source code in src/graphical/chart.py
LabelChartRow
dataclass
Content row for labeled chart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
Union[RenderableType, Segment]
|
RenderableType representing the content. |
required |
content_width
|
int
|
Width of the content. |
required |
label
|
str
|
Label of the content line. |
''
|
Source code in src/graphical/chart.py
content
instance-attribute
Union[RenderableType, Segment]: Content line rendered in the chart.
content_width
instance-attribute
int: Width of the chart
label = ''
class-attribute
instance-attribute
str: Label of the content line.