pub struct Config {
pub chart_area: ChartArea,
pub top_x: AxisOptions,
pub bottom_x: AxisOptions,
pub left_y: AxisOptions,
pub right_y: AxisOptions,
pub chart_title: ChartTitleOptions,
pub grid: GridOptions,
pub legend: Legend,
pub picked_points: Option<PickedPointsConfig>,
pub picked_data: Option<DataSelectionsConfig>,
pub colorbar: Option<ColorBarOptions>,
pub draw_style: DrawStyle,
}Fields§
§chart_area: ChartArea§top_x: AxisOptions§bottom_x: AxisOptions§left_y: AxisOptions§right_y: AxisOptions§chart_title: ChartTitleOptions§grid: GridOptions§legend: Legend§picked_points: Option<PickedPointsConfig>§picked_data: Option<DataSelectionsConfig>Typed point/bin/cell/contour selections. Additive to the legacy
picked_points field so existing documents and hosts keep their exact
point-only contract.
colorbar: Option<ColorBarOptions>The colourbar and, with it, the chart’s z scale. None (key absent in
JSON) is a chart with no z dimension — the shape of every document
written before field series existed.
draw_style: DrawStyleChart-global render style. Precise (default, key absent in JSON) is
identical to current rendering; every other variant is an opt-in
stylized mode. No per-series mixing.
Implementations§
Source§impl Config
impl Config
pub fn auto_significant_digits_all(&mut self)
Source§impl Config
impl Config
pub fn fit_to_data_area( &mut self, target: DataArea, strategy: FitStrategy, ) -> Result<(), LayoutError>
pub fn resize_chart_area( &mut self, new_area: ChartArea, ) -> Result<(), LayoutError>
pub fn resize_chart_area_scaled( &mut self, new_area: ChartArea, ) -> Result<(), LayoutError>
pub fn set_side_margin( &mut self, side: Side, value: f32, ) -> Result<(), LayoutError>
pub fn set_margins( &mut self, margins: Margins, strategy: FitStrategy, ) -> Result<(), LayoutError>
Source§impl Config
impl Config
Sourcepub fn nudge(&mut self, element: Element, dx: f32, dy: f32) -> NudgeResult
pub fn nudge(&mut self, element: Element, dx: f32, dy: f32) -> NudgeResult
Apply a measurement-free approximate containment policy. Text-bearing
elements use representative anchors here; exact glyph bounds are kept
in the Selectable path and no text measurer is required by nudge.
pub fn nudge_x(&mut self, element: Element, dx: f32) -> NudgeResult
pub fn nudge_y(&mut self, element: Element, dy: f32) -> NudgeResult
Source§impl Config
impl Config
pub fn margins(&self) -> Margins
pub fn data_area(&self) -> Result<DataArea, LayoutError>
Sourcepub fn colorbar_band(&self, side: &Side) -> f32
pub fn colorbar_band(&self, side: &Side) -> f32
How far this side’s axis band is pushed in from the chart-area edge by the colourbar band. Zero on the three sides the bar is not on, and when it is hidden.
Public because everything that positions chrome against the chart edge — the axis title’s placement, its hit box, its nudge anchor — needs the same number, and computing it separately in each is how they drift apart.
pub fn validate(&self) -> Result<(), LayoutError>
Source§impl Config
impl Config
Sourcepub fn apply_axis_preset(&mut self, preset: AxisPreset)
pub fn apply_axis_preset(&mut self, preset: AxisPreset)
Apply preset to all four axes at once. See AxisPreset for what
is (and is not) touched.