Skip to main content

TimeSeries

Struct TimeSeries 

Source
pub struct TimeSeries { /* private fields */ }
Expand description

Time Series Chart widget

Implementations§

Source§

impl TimeSeries

Source

pub fn new() -> Self

Create a new time series chart

Source

pub fn title(self, title: impl Into<String>) -> Self

Set chart title

Source

pub fn series(self, data: TimeSeriesData) -> Self

Add a data series

Source

pub fn time_format(self, format: TimeFormat) -> Self

Set time format

Source

pub fn time_range(self, range: TimeRange) -> Self

Set time range

Source

pub fn y_label(self, label: impl Into<String>) -> Self

Set Y-axis label

Source

pub fn show_grid(self, show: bool) -> Self

Show or hide grid

Source

pub fn show_legend(self, show: bool) -> Self

Show or hide legend

Source

pub fn y_min(self, min: f64) -> Self

Set Y-axis minimum

Source

pub fn y_max(self, max: f64) -> Self

Set Y-axis maximum

Source

pub fn y_range(self, min: f64, max: f64) -> Self

Set Y-axis range

Source

pub fn marker(self, marker: TimeMarker) -> Self

Add a marker

Source

pub fn bg(self, color: Color) -> Self

Set background color

Source

pub fn grid_color(self, color: Color) -> Self

Set grid color

Source

pub fn height(self, height: u16) -> Self

Set height

Source

pub fn get_time_bounds(&self) -> (u64, u64)

Get time bounds for the current time range

Source

pub fn get_value_bounds(&self) -> (f64, f64)

Get value bounds for the current data

Source

pub fn format_time(&self, timestamp: u64, range: u64) -> String

Format a timestamp for display

Source§

impl TimeSeries

Source

pub fn element_id(self, id: impl Into<String>) -> Self

Set element ID for CSS selector (#id)

Source

pub fn class(self, class: impl Into<String>) -> Self

Add a CSS class

Source

pub fn classes<I, S>(self, classes: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Add multiple CSS classes

Trait Implementations§

Source§

impl Clone for TimeSeries

Source§

fn clone(&self) -> TimeSeries

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TimeSeries

Source§

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

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

impl Default for TimeSeries

Source§

fn default() -> Self

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

impl StyledView for TimeSeries

Source§

fn set_id(&mut self, id: impl Into<String>)

Set element ID
Source§

fn add_class(&mut self, class: impl Into<String>)

Add a CSS class
Source§

fn remove_class(&mut self, class: &str)

Remove a CSS class
Source§

fn toggle_class(&mut self, class: &str)

Toggle a CSS class
Source§

fn has_class(&self, class: &str) -> bool

Check if has class
Source§

impl View for TimeSeries

Source§

fn render(&self, ctx: &mut RenderContext<'_>)

Render the view to the given context Read more
Source§

fn id(&self) -> Option<&str>

Get element ID (for CSS #id selectors) Read more
Source§

fn classes(&self) -> &[String]

Get CSS classes (for CSS .class selectors) Read more
Source§

fn meta(&self) -> WidgetMeta

Get widget metadata for DOM Read more
Source§

fn widget_type(&self) -> &'static str

Get widget type name (for CSS type selectors) Read more
Source§

fn children(&self) -> &[Box<dyn View>]

Get child views (for container widgets) Read more

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.