pub struct ChartOptions {Show 14 fields
pub chart_type: ChartType,
pub x_column: Option<String>,
pub y_column: Option<String>,
pub series_column: Option<String>,
pub title: Option<String>,
pub format: ChartFormat,
pub width: u32,
pub height: u32,
pub bins: u32,
pub x_as_category: Option<bool>,
pub x_range: Option<[f64; 2]>,
pub y_range: Option<[f64; 2]>,
pub color_map: HashMap<String, RGBColor>,
pub label_points: bool,
}Expand description
User-facing chart configuration, parsed from MCP tool parameters.
Fields§
§chart_type: ChartType§x_column: Option<String>§y_column: Option<String>§series_column: Option<String>§title: Option<String>§format: ChartFormat§width: u32§height: u32§bins: u32§x_as_category: Option<bool>Override the chart-type-specific default for how the x column is interpreted:
None(default): use the chart type’s natural behavior —Bartreats x as categorical,Line/Scatterrequire numeric x.Some(true): force categorical even onLine/Scatter. Essential for plotting values whose natural axis is a string / date / enum (e.g.SELECT day, happiness_scorewheredayis aDATE).Some(false): force numeric even onBar(rarely useful — bar charts are almost always categorical).
When categorical mode is active the rendered x axis uses the original string representation of each distinct x value as its tick label, in the order x values are first seen.
x_range: Option<[f64; 2]>Fix the x-axis range as [min, max]. When set, auto-scaling is
skipped and all frames/charts share the same x extent. Useful for
side-by-side comparisons or animation where a consistent scale
matters. Ignored for bar charts (which use categorical positions).
y_range: Option<[f64; 2]>Fix the y-axis range as [min, max]. Same semantics as x_range.
color_map: HashMap<String, RGBColor>Map series names to hex colors ("#rrggbb"). Entries that match a
series name override the default palette; unmatched series still
cycle through palette colors. Only affects charts with a series
column; single-series charts use the first palette color as before.
label_points: boolWhen true, draw the series name as a text label next to each dot
on scatter (and each point on line) charts, and suppress the legend
entirely. Useful when each series has exactly one point (e.g. one
country per dot) and a legend would be redundant.
Labels are drawn 6 pixels right and 4 pixels above the data point.
No collision avoidance is performed — for dense data the legend
(label_points: false, the default) is usually more readable.
Trait Implementations§
Source§impl Clone for ChartOptions
impl Clone for ChartOptions
Source§fn clone(&self) -> ChartOptions
fn clone(&self) -> ChartOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChartOptions
impl Debug for ChartOptions
Auto Trait Implementations§
impl Freeze for ChartOptions
impl RefUnwindSafe for ChartOptions
impl Send for ChartOptions
impl Sync for ChartOptions
impl Unpin for ChartOptions
impl UnsafeUnpin for ChartOptions
impl UnwindSafe for ChartOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request