ChartBrush
chartBrush · Charts · interactive
Charts: a scale, its ticks, and a line or area drawn from data.
Import
cpp
#include "gbui/widgets/chart.hpp"Example
cpp
bool chartBrush(Ui& ui, const Interaction& input, std::string_view id, const std::vector<Series>& series, ChartView& view, const BrushOptions& options = {});A strip of the whole series with the current view as a window over it. The part an ApexCharts-style brush actually earns its keep with is not the zooming — a drag inside the plot does that, and so does the wheel — but the context: once zoomed in, a reader has no way to tell where they are or how much they cannot see. The strip answers both without them having to zoom back out, which is also why it is optional. Returns true on any frame the view moved.
API
BrushOptions
| Option | Type | Default | What it does |
|---|---|---|---|
height | float | 46.0f | |
axisWidth | float | 0.0f | Room down the left, so the strip lines up with the chart above it. |
handleWidth | float | 8.0f | Handle width, and the smallest grabbable window. |
dragSelects | bool | true | Dragging the strip's empty part draws a new window instead of moving the existing one — which is how a reader selects a range they can see but are not in. |