Skip to content

rs_rich.chart

Generated from the type stubs by scripts/gen_python_api.py; do not edit.

rs_rich.chart: charts drawn with text (rich_ext::chart; no Rich counterpart).

Sparklines, bars and histograms, Braille line and scatter charts, gauges and bullet charts, heatmaps, status matrices, KPI cards and timelines. Each is a renderable: print it, or put it in a Table cell, a Panel or a Live display. None writes a line wider than the width it gets, and none needs colour to be read.

Settings are keyword arguments; charset is "auto", "blocks", "braille" or "ascii", and format is "compact" (1.2k) or a number of decimals. None in a list of values is a gap.

CHART_STYLES module-attribute

CHART_STYLES: List[Tuple[str, str]]

Bar module-attribute

Bar = ChartBar

State module-attribute

State = ChartState

Span module-attribute

Span = TimelineSpan

STYLES module-attribute

STYLES = CHART_STYLES

format_value module-attribute

format_value = chart_format

Band

upto property

upto: float

label property

label: str

style property

style: Optional[str]

BarChart

BulletChart

ChartBar

label property

label: str

value property

value: float

style property

style: Optional[str]

ChartState

name property

name: str

symbol property

symbol: str

ascii property

ascii: str

style property

style: str

pass_ staticmethod

pass_() -> ChartState

fail staticmethod

fail() -> ChartState

skip staticmethod

skip() -> ChartState

flaky staticmethod

flaky() -> ChartState

Gauge

value property

value: float

band property

band: Optional[str]

Heatmap

scale property

scale: Tuple[float, float]

Histogram

edges

edges() -> List[float]

counts

counts() -> List[int]

KpiCard

LineChart

Series

name property

name: str

points property

points: List[Tuple[float, float]]

kind property

kind: str

Sparkline

values property

values: List[float]

StatusMatrix

counts

counts() -> List[Tuple[str, int]]

Timeline

rows property

rows: List[str]

TimelineSpan

row property

row: str

start property

start: float

end property

end: float

chart_format

chart_format(value: float, format: ChartFormat = None) -> str