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): auto-detect from the first row’s x value.- For
Bar: always categorical. - For
Line/Scatter: numeric x → numeric axis; DATE / TIMESTAMP / TIMESTAMPTZ string → proportional time axis (positions are real Unix epoch seconds, ticks formatted in the matching kind); TEXT → categorical fallback.
- For
Some(true): force categorical layout (synthetic sequential x positions, original strings as tick labels). Useful when you want even spacing on temporal data — e.g. one bar per business day with no visual gap for weekends.Some(false): force numeric x. Errors for non-numeric inputs onLine/Scatter. Rarely useful onBar.
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. When time mode is active, gaps between data points reflect real wall-clock time rather than insertion order.
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§
impl<T> Allocation for T
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