Mixed bar-and-line chart on a shared axis.
| 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_bar_series | add_bar_series overloads |
add_line_series | add_line_series overloads |
add_series | add_series overloads |
apply_theme | Apply a ChartTheme to this chart's color and typography options. |
bar_options | Mutable access to the bar series' layout/shape/label options (mode is unused here). |
cartesian_options | Mutable Cartesian options. |
categories | Category labels. |
clear_series | Clear all series and kind tags. |
clone [virtual] | |
draw [virtual] | Draw the whole chart into target (raster, SVG or PDF). Returns true. |
line_options | Mutable line-series drawing options. |
options | options overloads |
render [virtual] | Render axes, grid, legend, and series to RGBA. |
series | All data series. |
set_categories | Set category labels (x-axis). |
set_group_gap | Gap between category groups as a fraction of the slot width. |
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] | |
compute_y2_min [virtual] | |
compute_y_max [virtual] | |
compute_y_min [virtual] | |
draw_axes_and_grid | |
draw_background | |
draw_legend | |
draw_overlay [virtual] | |
draw_series [virtual] | |
draw_title | |
has_secondary_y_axis [virtual] | |
is_horizontal [virtual] | Whether to lay out the plot with a horizontal value axis (bottom) and a vertical category axis (left), instead of the default vertical value axis (left) / horizontal category axis (bottom). Default: false. Overridden by BarChart based on BarOptions::orientation; not meaningful for Line/Area/Combo's point-based geometry, so they don't override it. ReferenceLine / ReferenceBand overlays are not supported in horizontal mode (v1) since their orientation semantics assume a vertical value axis. |
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] | True when the primary value axis is a 0-100 share (100%-stacked charts); labels get %. |
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 |
|---|---|
detail::build_chart_svg | Render chart as a native-vector SVG document. |
Bar series are drawn as grouped vertical bars; line series are overlaid as polylines with optional point markers. Both share the same x-categories and y-axis, and all series appear in the legend.
ComboChart combo;
combo.set_categories({"Mon", "Tue", "Wed", "Thu", "Fri"});
combo.add_bar_series("Average", {30, 45, 28, 52, 38},
Color::rgb(75, 192, 77));
combo.add_line_series("Peak", {55, 70, 48, 80, 65},
Color::rgb(75, 135, 192));
ChartExporter::save(combo, "sessions.png");