Vertical bar chart.
| Name | Description |
|---|---|
CartesianChart | Abstract base for charts with x/y axes, categories, and multiple series. |
| Name | Description |
|---|---|
PlotContext | Context passed to draw_series() and draw_overlay() during rendering. |
| Name | Description |
|---|---|
add_series | add_series overloads |
apply_theme | Apply a ChartTheme to this chart's color and typography options. |
bar_options | Mutable access to all bar layout/shape/label options. |
cartesian_options | Mutable Cartesian options. |
categories | Category labels. |
clear_series | Remove all series (categories unchanged). |
clone [virtual] | |
draw [virtual] | Draw the whole chart into target (raster, SVG or PDF). Returns true. |
mode | Current bar layout mode. |
options | options overloads |
orientation | Current bar direction. |
render [virtual] | Render axes, grid, legend, and series to RGBA. |
series | All data series. |
set_bar_gap | Gap between bars within a group (grouped mode only). |
set_categories | Set category labels (x-axis). |
set_group_gap | Gap between category groups as a fraction of slot width. |
set_mode | Set grouped (default) or stacked bar layout. |
set_orientation | Set vertical (default) or horizontal bar direction. |
set_x_values | Set per-point numeric x-values (e.g. Unix timestamps) for continuous x-axis positioning, in place of evenly-spaced categories. |
vector_capability [virtual] | |
x_values | Numeric x-values set via set_x_values, if any. |
| Name | Description |
|---|---|
compute_plot_rect | Compute plot rectangle inside the image buffer. |
compute_y2_max [virtual] | Maximum value for the secondary y-axis domain. |
compute_y2_min [virtual] | Minimum value for the secondary y-axis domain. |
compute_y_max [virtual] | |
compute_y_min [virtual] | Minimum y value for scale (default: 0 or data min). |
draw_axes_and_grid | |
draw_background | |
draw_legend | |
draw_overlay [virtual] | |
draw_series [virtual] | |
draw_title | |
has_secondary_y_axis [virtual] | Whether to render a secondary (right-side) y-axis. Default: false. |
is_horizontal [virtual] | |
supports_continuous_x_axis [virtual] | Whether this chart type can position its x-axis by continuous numeric value (via set_x_values / CartesianOptions::x_scale_type) instead of evenly-spaced categories. Default: false. Overridden by LineChart and AreaChart, whose point-based geometry has a well-defined continuous position; not by BarChart/ComboChart, whose fixed-width bar-per-category layout does not. |
x_label_row_height | Height of the x-axis label row (one line, or the longest label when rotated). |
x_labels_rotated | True when x-axis labels are drawn rotated 90° (grows the bottom margin). |
y_axis_is_percent [virtual] | |
y_tick_label | Primary value-axis tick label (honours y_axis_is_percent and the formatters). |
| Name |
|---|
cartesian_ |
categories_ |
options_ |
series_ |
x_values_ |
| Name | Description |
|---|---|
make_histogram_chart | Builds a bar chart of a histogram: one touching bar per bin, labelled "lo-hi". |
detail::build_chart_svg | Render chart as a native-vector SVG document. |
BarChart bar;
bar.set_categories({"Q1", "Q2", "Q3"});
bar.add_series("2024", {100, 120, 90});
bar.add_series("2025", {110, 130, 95});
ChartExporter::save(bar, "bars.png");