insightdock::charts::CartesianChart

Abstract base for charts with x/y axes, categories, and multiple series.

Synopsis

Declared in <insightdock/cartesian_chart.h>
class CartesianChart
    : public Chart

Base Classes

Name Description
ChartAbstract base for all chart types.

Types

Name Description
PlotContext Context passed to draw_series() and draw_overlay() during rendering.

Member Functions

Name Description
add_series add_series overloads
apply_theme Apply a ChartTheme to this chart's color and typography options.
cartesian_options Mutable Cartesian options.
categories Category labels.
clear_series Remove all series (categories unchanged).
clone [virtual]Deep copy of this chart, or nullptr if the concrete type doesn't support it.
draw [virtual]Draw the whole chart into target (raster, SVG or PDF). Returns true.
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_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.

Protected Member Functions

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]Maximum y value for scale (default: data max with padding).
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]Extension point for custom overlays drawn after draw_series.
draw_series [virtual]Draw bars, lines, or other series geometry (implemented by subclass).
draw_title
has_secondary_y_axis [virtual]Whether to render a secondary (right-side) y-axis. Default: false.
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).

Protected Data Members

Name
cartesian_
categories_
options_
series_
x_values_

Non-Member Functions

Name Description
detail::build_chart_svgRender chart as a native-vector SVG document.

Derived Classes

Name Description
AreaChart Area chart — filled polygons from series values down to the baseline.
BarChart Vertical bar chart.
ComboChart Mixed bar-and-line chart on a shared axis.
LineChart Multi-series line chart.

Description

Handles background, title, axes, grid, legend, and plot layout. Subclasses implement draw_series() for bar or line geometry.

See Also

BarChart, LineChart

Created with MrDocs