Skip to main content

LineChart

Struct LineChart 

Source
pub struct LineChart<'a> {
    pub series: &'a [LcSeries<'a>],
    pub x: u8,
    pub x_range: (f64, f64),
    pub x_span: f64,
    pub y_range: (f64, f64),
    pub markers: &'a [LcMarker<'a>],
    pub thresholds: &'a [LcThreshold<'a>],
    pub flags: u32,
    pub name: &'a str,
    pub empty: &'a str,
}
Expand description

what ui.line_chart shows: the series and how (see the module header of chart.rs); build it with LineChart::new(&series) and the setters, or change the fields

Fields§

§series: &'a [LcSeries<'a>]§x: u8

the x axis: LX_SECS (default), LX_NANOS or LX_NUM

§x_range: (f64, f64)

the visible x range (the points’ units); empty (the default) = the data’s

§x_span: f64

follow live: without x_range the newest x_span of the data (0 = all of it)

§y_range: (f64, f64)

the y range; a NaN end (the default) is automatic: the visible values and the thresholds, out to the next tick. (0.0, f64::NAN): from zero (metrics)

§markers: &'a [LcMarker<'a>]§thresholds: &'a [LcThreshold<'a>]§flags: u32

LC_*

§name: &'a str

the chart’s name: the start of its summary (screen readers)

§empty: &'a str

the text without points (“” = “Keine Daten” in the UI language)

Implementations§

Source§

impl<'a> LineChart<'a>

Source

pub const fn new(series: &'a [LcSeries<'a>]) -> LineChart<'a>

the series over time in seconds, both ranges automatic

Source

pub const fn x_axis(self, x: u8) -> LineChart<'a>

the x axis: LX_SECS, LX_NANOS or LX_NUM

Source

pub const fn x_range(self, lo: f64, hi: f64) -> LineChart<'a>

a fixed x range (a paused view)

Source

pub const fn follow(self, span: f64) -> LineChart<'a>

follow live: the newest span of the data

Source

pub const fn y_range(self, lo: f64, hi: f64) -> LineChart<'a>

the y range (a NaN end: automatic)

Source

pub const fn markers(self, m: &'a [LcMarker<'a>]) -> LineChart<'a>

markers on the x axis (lines and shaded ranges with tags)

Source

pub const fn thresholds(self, t: &'a [LcThreshold<'a>]) -> LineChart<'a>

thresholds (dashed lines with tags)

Source

pub const fn flags(self, f: u32) -> LineChart<'a>

LC_* flags

Source

pub const fn name(self, n: &'a str) -> LineChart<'a>

the name its summary starts with

Source

pub const fn empty(self, s: &'a str) -> LineChart<'a>

the text of the empty chart

Source

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

the x range the chart shows (the points’ units): x_range when it is set, else the data’s – with x_span the newest x_span of it (from the first point on while the data is shorter: it grows from the left); without points 0 .. x_span (or one second)

Trait Implementations§

Source§

impl<'a> Clone for LineChart<'a>

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<'a> Copy for LineChart<'a>

Source§

impl<'a> Debug for LineChart<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for LineChart<'a>

§

impl<'a> Freeze for LineChart<'a>

§

impl<'a> RefUnwindSafe for LineChart<'a>

§

impl<'a> Send for LineChart<'a>

§

impl<'a> Sync for LineChart<'a>

§

impl<'a> Unpin for LineChart<'a>

§

impl<'a> UnsafeUnpin for LineChart<'a>

§

impl<'a> UnwindSafe for LineChart<'a>

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> ErasedDestructor for T
where T: 'static,

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.