Skip to main content

ChartOption

Struct ChartOption 

Source
pub struct ChartOption {
Show 29 fields pub title: Option<TitleOption>, pub legend: Option<LegendOption>, pub grid: Option<GridOption>, pub x_axis: Vec<AxisOption>, pub y_axis: Vec<AxisOption>, pub polar: Vec<PolarOption>, pub radar: Vec<RadarOption>, pub geo: Vec<GeoOption>, pub calendar: Vec<CalendarOption>, pub dataset: Option<DatasetOption>, pub series: Vec<SeriesOption>, pub tooltip: Option<TooltipOption>, pub toolbox: Option<ToolboxOption>, pub data_zoom: Vec<DataZoomOption>, pub visual_map: Vec<VisualMapOption>, pub graphic: Vec<GraphicOption>, pub brush: Option<BrushOption>, pub axis_pointer: Option<AxisPointerOption>, pub color: Vec<String>, pub background_color: Option<String>, pub text_style: Option<LabelOption>, pub animation: bool, pub animation_duration: Option<f64>, pub animation_easing: Option<String>, pub animation_delay: Option<f64>, pub animation_duration_update: Option<f64>, pub animation_easing_update: Option<String>, pub use_utc: Option<bool>, pub aria: Option<AriaOption>,
}
Expand description

The whole configuration of a chart.

The field names mirror ECharts’ option object, so an ECharts configuration can be translated field by field.

Fields§

§title: Option<TitleOption>

The title of the chart.

§legend: Option<LegendOption>

The legend of the chart.

§grid: Option<GridOption>

The cartesian grid of the chart.

§x_axis: Vec<AxisOption>

The x-axes of the chart.

§y_axis: Vec<AxisOption>

The y-axes of the chart.

§polar: Vec<PolarOption>

The polar coordinate systems of the chart.

§radar: Vec<RadarOption>

The radar coordinate systems of the chart.

§geo: Vec<GeoOption>

The geo components of the chart.

§calendar: Vec<CalendarOption>

The calendar components of the chart.

§dataset: Option<DatasetOption>

The dataset the chart draws its data from.

§series: Vec<SeriesOption>

The series of the chart.

§tooltip: Option<TooltipOption>

The tooltip of the chart.

§toolbox: Option<ToolboxOption>

The toolbox of the chart.

§data_zoom: Vec<DataZoomOption>

The data-zoom controls of the chart.

§visual_map: Vec<VisualMapOption>

The visual maps of the chart.

§graphic: Vec<GraphicOption>

The graphic elements of the chart.

§brush: Option<BrushOption>

The brush of the chart.

§axis_pointer: Option<AxisPointerOption>

The axis pointer of the chart.

§color: Vec<String>

The palette the series take their colours from.

§background_color: Option<String>

The background colour of the chart.

§text_style: Option<LabelOption>

The default text style of the chart.

§animation: bool

Whether the chart animates.

§animation_duration: Option<f64>

The duration of the chart’s animation, in milliseconds.

§animation_easing: Option<String>

The easing of the chart’s animation.

§animation_delay: Option<f64>

The delay of the chart’s animation, in milliseconds.

§animation_duration_update: Option<f64>

The duration of the update animation, in milliseconds.

§animation_easing_update: Option<String>

The easing of the update animation.

§use_utc: Option<bool>

Whether the chart is rendered on a separate canvas layer.

§aria: Option<AriaOption>

The accessible description of the chart.

Implementations§

Source§

impl ChartOption

Inherent implementation of ChartOption.

Source

pub fn new() -> Self

Returns an empty configuration.

Source

pub fn title(self, title: TitleOption) -> Self

Sets the title.

§Arguments
  • TitleOption - A TitleOption parameter.
Source

pub fn legend(self, legend: LegendOption) -> Self

Sets the legend.

§Arguments
  • LegendOption - A LegendOption parameter.
Source

pub fn grid(self, grid: GridOption) -> Self

Sets the cartesian grid.

§Arguments
  • GridOption - A GridOption parameter.
Source

pub fn x_axis(self, axis: AxisOption) -> Self

Adds an x-axis.

§Arguments
  • AxisOption - A AxisOption parameter.
Source

pub fn y_axis(self, axis: AxisOption) -> Self

Adds a y-axis.

§Arguments
  • AxisOption - A AxisOption parameter.
Source

pub fn polar(self, polar: PolarOption) -> Self

Adds a polar coordinate system.

§Arguments
  • PolarOption - A PolarOption parameter.
Source

pub fn radar(self, radar: RadarOption) -> Self

Adds a radar coordinate system.

§Arguments
  • RadarOption - A RadarOption parameter.
Source

pub fn geo(self, geo: GeoOption) -> Self

Adds a geo component.

§Arguments
  • GeoOption - A GeoOption parameter.
Source

pub fn calendar(self, calendar: CalendarOption) -> Self

Adds a calendar component.

§Arguments
  • CalendarOption - A CalendarOption parameter.
Source

pub fn dataset(self, dataset: DatasetOption) -> Self

Sets the dataset.

§Arguments
  • DatasetOption - A DatasetOption parameter.
Source

pub fn series(self, series: SeriesOption) -> Self

Adds a series.

§Arguments
  • SeriesOption - A SeriesOption parameter.
Source

pub fn tooltip(self, tooltip: TooltipOption) -> Self

Sets the tooltip.

§Arguments
  • TooltipOption - A TooltipOption parameter.
Source

pub fn toolbox(self, toolbox: ToolboxOption) -> Self

Sets the toolbox.

§Arguments
  • ToolboxOption - A ToolboxOption parameter.
Source

pub fn data_zoom(self, data_zoom: DataZoomOption) -> Self

Adds a data-zoom control.

§Arguments
  • DataZoomOption - A DataZoomOption parameter.
Source

pub fn visual_map(self, visual_map: VisualMapOption) -> Self

Adds a visual map.

§Arguments
  • VisualMapOption - A VisualMapOption parameter.
Source

pub fn graphic(self, graphic: GraphicOption) -> Self

Adds a graphic element.

§Arguments
  • GraphicOption - A GraphicOption parameter.
Source

pub fn brush(self, brush: BrushOption) -> Self

Sets the brush.

§Arguments
  • BrushOption - A BrushOption parameter.
Source

pub fn axis_pointer(self, axis_pointer: AxisPointerOption) -> Self

Sets the axis pointer.

§Arguments
  • AxisPointerOption - A AxisPointerOption parameter.
Source

pub fn color(self, color: Vec<String>) -> Self

Sets the palette the series take their colours from.

§Arguments
  • Vec<String> - A Vec<String> parameter.
Source

pub fn add_color(self, color: &str) -> Self

Adds one colour to the palette.

§Arguments
  • &str - Shared reference to a str.
Source

pub fn background_color(self, color: &str) -> Self

Sets the background colour of the chart.

§Arguments
  • &str - Shared reference to a str.
Source

pub fn text_style(self, text_style: LabelOption) -> Self

Sets the default text style of the chart.

§Arguments
  • LabelOption - A LabelOption parameter.
Source

pub fn animation(self, animation: bool) -> Self

Sets whether the chart animates.

§Arguments
  • bool - A boolean (bool).
Source

pub fn animation_duration(self, duration: f64) -> Self

Sets the duration of the chart’s animation, in milliseconds.

§Arguments
  • f64 - A 64-bit float (f64).
Source§

impl ChartOption

Source

pub fn get_title(&self) -> Option<TitleOption>

Source

pub fn try_get_title(&self) -> Option<TitleOption>

Source

pub fn get_mut_title(&mut self) -> &mut Option<TitleOption>

Source

pub fn set_title(&mut self, val: Option<TitleOption>) -> &mut Self

Source

pub fn get_legend(&self) -> Option<LegendOption>

Source

pub fn try_get_legend(&self) -> Option<LegendOption>

Source

pub fn get_mut_legend(&mut self) -> &mut Option<LegendOption>

Source

pub fn set_legend(&mut self, val: Option<LegendOption>) -> &mut Self

Source

pub fn get_grid(&self) -> Option<GridOption>

Source

pub fn try_get_grid(&self) -> Option<GridOption>

Source

pub fn get_mut_grid(&mut self) -> &mut Option<GridOption>

Source

pub fn set_grid(&mut self, val: Option<GridOption>) -> &mut Self

Source

pub fn get_x_axis(&self) -> &Vec<AxisOption>

Source

pub fn get_mut_x_axis(&mut self) -> &mut Vec<AxisOption>

Source

pub fn set_x_axis(&mut self, val: Vec<AxisOption>) -> &mut Self

Source

pub fn get_y_axis(&self) -> &Vec<AxisOption>

Source

pub fn get_mut_y_axis(&mut self) -> &mut Vec<AxisOption>

Source

pub fn set_y_axis(&mut self, val: Vec<AxisOption>) -> &mut Self

Source

pub fn get_polar(&self) -> &Vec<PolarOption>

Source

pub fn get_mut_polar(&mut self) -> &mut Vec<PolarOption>

Source

pub fn set_polar(&mut self, val: Vec<PolarOption>) -> &mut Self

Source

pub fn get_radar(&self) -> &Vec<RadarOption>

Source

pub fn get_mut_radar(&mut self) -> &mut Vec<RadarOption>

Source

pub fn set_radar(&mut self, val: Vec<RadarOption>) -> &mut Self

Source

pub fn get_geo(&self) -> &Vec<GeoOption>

Source

pub fn get_mut_geo(&mut self) -> &mut Vec<GeoOption>

Source

pub fn set_geo(&mut self, val: Vec<GeoOption>) -> &mut Self

Source

pub fn get_calendar(&self) -> &Vec<CalendarOption>

Source

pub fn get_mut_calendar(&mut self) -> &mut Vec<CalendarOption>

Source

pub fn set_calendar(&mut self, val: Vec<CalendarOption>) -> &mut Self

Source

pub fn get_dataset(&self) -> Option<DatasetOption>

Source

pub fn try_get_dataset(&self) -> Option<DatasetOption>

Source

pub fn get_mut_dataset(&mut self) -> &mut Option<DatasetOption>

Source

pub fn set_dataset(&mut self, val: Option<DatasetOption>) -> &mut Self

Source

pub fn get_series(&self) -> &Vec<SeriesOption>

Source

pub fn get_mut_series(&mut self) -> &mut Vec<SeriesOption>

Source

pub fn set_series(&mut self, val: Vec<SeriesOption>) -> &mut Self

Source

pub fn get_tooltip(&self) -> Option<TooltipOption>

Source

pub fn try_get_tooltip(&self) -> Option<TooltipOption>

Source

pub fn get_mut_tooltip(&mut self) -> &mut Option<TooltipOption>

Source

pub fn set_tooltip(&mut self, val: Option<TooltipOption>) -> &mut Self

Source

pub fn get_toolbox(&self) -> Option<ToolboxOption>

Source

pub fn try_get_toolbox(&self) -> Option<ToolboxOption>

Source

pub fn get_mut_toolbox(&mut self) -> &mut Option<ToolboxOption>

Source

pub fn set_toolbox(&mut self, val: Option<ToolboxOption>) -> &mut Self

Source

pub fn get_data_zoom(&self) -> &Vec<DataZoomOption>

Source

pub fn get_mut_data_zoom(&mut self) -> &mut Vec<DataZoomOption>

Source

pub fn set_data_zoom(&mut self, val: Vec<DataZoomOption>) -> &mut Self

Source

pub fn get_visual_map(&self) -> &Vec<VisualMapOption>

Source

pub fn get_mut_visual_map(&mut self) -> &mut Vec<VisualMapOption>

Source

pub fn set_visual_map(&mut self, val: Vec<VisualMapOption>) -> &mut Self

Source

pub fn get_graphic(&self) -> &Vec<GraphicOption>

Source

pub fn get_mut_graphic(&mut self) -> &mut Vec<GraphicOption>

Source

pub fn set_graphic(&mut self, val: Vec<GraphicOption>) -> &mut Self

Source

pub fn get_brush(&self) -> Option<BrushOption>

Source

pub fn try_get_brush(&self) -> Option<BrushOption>

Source

pub fn get_mut_brush(&mut self) -> &mut Option<BrushOption>

Source

pub fn set_brush(&mut self, val: Option<BrushOption>) -> &mut Self

Source

pub fn get_axis_pointer(&self) -> Option<AxisPointerOption>

Source

pub fn try_get_axis_pointer(&self) -> Option<AxisPointerOption>

Source

pub fn get_mut_axis_pointer(&mut self) -> &mut Option<AxisPointerOption>

Source

pub fn set_axis_pointer(&mut self, val: Option<AxisPointerOption>) -> &mut Self

Source

pub fn get_color(&self) -> &Vec<String>

Source

pub fn get_mut_color(&mut self) -> &mut Vec<String>

Source

pub fn set_color(&mut self, val: Vec<String>) -> &mut Self

Source

pub fn get_background_color(&self) -> Option<String>

Source

pub fn try_get_background_color(&self) -> Option<String>

Source

pub fn get_mut_background_color(&mut self) -> &mut Option<String>

Source

pub fn set_background_color(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_text_style(&self) -> Option<LabelOption>

Source

pub fn try_get_text_style(&self) -> Option<LabelOption>

Source

pub fn get_mut_text_style(&mut self) -> &mut Option<LabelOption>

Source

pub fn set_text_style(&mut self, val: Option<LabelOption>) -> &mut Self

Source

pub fn get_animation(&self) -> bool

Source

pub fn get_mut_animation(&mut self) -> &mut bool

Source

pub fn set_animation(&mut self, val: bool) -> &mut Self

Source

pub fn get_animation_duration(&self) -> Option<f64>

Source

pub fn try_get_animation_duration(&self) -> Option<f64>

Source

pub fn get_mut_animation_duration(&mut self) -> &mut Option<f64>

Source

pub fn set_animation_duration(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_animation_easing(&self) -> Option<String>

Source

pub fn try_get_animation_easing(&self) -> Option<String>

Source

pub fn get_mut_animation_easing(&mut self) -> &mut Option<String>

Source

pub fn set_animation_easing(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_animation_delay(&self) -> Option<f64>

Source

pub fn try_get_animation_delay(&self) -> Option<f64>

Source

pub fn get_mut_animation_delay(&mut self) -> &mut Option<f64>

Source

pub fn set_animation_delay(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_animation_duration_update(&self) -> Option<f64>

Source

pub fn try_get_animation_duration_update(&self) -> Option<f64>

Source

pub fn get_mut_animation_duration_update(&mut self) -> &mut Option<f64>

Source

pub fn set_animation_duration_update(&mut self, val: Option<f64>) -> &mut Self

Source

pub fn get_animation_easing_update(&self) -> Option<String>

Source

pub fn try_get_animation_easing_update(&self) -> Option<String>

Source

pub fn get_mut_animation_easing_update(&mut self) -> &mut Option<String>

Source

pub fn set_animation_easing_update(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_use_utc(&self) -> Option<bool>

Source

pub fn try_get_use_utc(&self) -> Option<bool>

Source

pub fn get_mut_use_utc(&mut self) -> &mut Option<bool>

Source

pub fn set_use_utc(&mut self, val: Option<bool>) -> &mut Self

Source

pub fn get_aria(&self) -> Option<AriaOption>

Source

pub fn try_get_aria(&self) -> Option<AriaOption>

Source

pub fn get_mut_aria(&mut self) -> &mut Option<AriaOption>

Source

pub fn set_aria(&mut self, val: Option<AriaOption>) -> &mut Self

Trait Implementations§

Source§

impl Clone for ChartOption

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChartOption

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ChartOption

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ChartOption

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ChartOption

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more