pub struct ChartReference { /* private fields */ }Expand description
A dashed line across a Chart at a value that matters, such as a target.
use ravenrs_style::Semantic;
use ravenrs_widgets::{Chart, ChartKind, ChartReference};
let chart = Chart::new(ChartKind::Bar)
.categories(["Jan", "Feb"])
.series("Sales", [12.0, 18.0])
.reference(ChartReference::new(15.0).label("Target").color(Semantic::Danger));Implementations§
Source§impl ChartReference
impl ChartReference
Sourcepub fn new(value: f64) -> ChartReference
pub fn new(value: f64) -> ChartReference
A line at this value, in the color of secondary text.
Sourcepub fn label(self, label: impl Into<String>) -> ChartReference
pub fn label(self, label: impl Into<String>) -> ChartReference
What it says, at its end.
Sourcepub fn color(self, color: Semantic) -> ChartReference
pub fn color(self, color: Semantic) -> ChartReference
Its color.
Trait Implementations§
Source§impl Clone for ChartReference
impl Clone for ChartReference
Source§fn clone(&self) -> ChartReference
fn clone(&self) -> ChartReference
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChartReference
impl Debug for ChartReference
Source§impl PartialEq for ChartReference
impl PartialEq for ChartReference
impl StructuralPartialEq for ChartReference
Auto Trait Implementations§
impl Freeze for ChartReference
impl RefUnwindSafe for ChartReference
impl Send for ChartReference
impl Sync for ChartReference
impl Unpin for ChartReference
impl UnsafeUnpin for ChartReference
impl UnwindSafe for ChartReference
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
Mutably borrows from an owned value. Read more