pub struct ChartContext<DB: DrawingBackend, CT: CoordTranslate> { /* private fields */ }Expand description
The context of the chart. This is the core object of Plotters. Any plot/chart is abstracted as this type, and any data series can be placed to the chart context.
Implementations§
Source§impl<DB: DrawingBackend, XT: Debug, YT: Debug, X: Ranged<ValueType = XT>, Y: Ranged<ValueType = YT>> ChartContext<DB, RangedCoord<X, Y>>
impl<DB: DrawingBackend, XT: Debug, YT: Debug, X: Ranged<ValueType = XT>, Y: Ranged<ValueType = YT>> ChartContext<DB, RangedCoord<X, Y>>
Sourcepub fn configure_mesh(&mut self) -> MeshStyle<'_, X, Y, DB>
pub fn configure_mesh(&mut self) -> MeshStyle<'_, X, Y, DB>
Initialize a mesh configuration object and mesh drawing can be finalized by calling
the function MeshStyle::draw
Source§impl<DB: DrawingBackend, CT: CoordTranslate> ChartContext<DB, CT>
impl<DB: DrawingBackend, CT: CoordTranslate> ChartContext<DB, CT>
Sourcepub fn configure_series_labels(&mut self) -> SeriesLabelStyle<'_, DB, CT>
pub fn configure_series_labels(&mut self) -> SeriesLabelStyle<'_, DB, CT>
Configure the styles for drawing series labels in the chart
Sourcepub fn plotting_area(&self) -> &DrawingArea<DB, CT>
pub fn plotting_area(&self) -> &DrawingArea<DB, CT>
Get a reference of underlying plotting area
Source§impl<DB: DrawingBackend, CT: ReverseCoordTranslate> ChartContext<DB, CT>
impl<DB: DrawingBackend, CT: ReverseCoordTranslate> ChartContext<DB, CT>
Sourcepub fn into_coord_trans(self) -> impl Fn(BackendCoord) -> Option<CT::From>
pub fn into_coord_trans(self) -> impl Fn(BackendCoord) -> Option<CT::From>
Convert the chart context into an closure that can be used for coordinate translation
Source§impl<DB: DrawingBackend, X: Ranged, Y: Ranged> ChartContext<DB, RangedCoord<X, Y>>
impl<DB: DrawingBackend, X: Ranged, Y: Ranged> ChartContext<DB, RangedCoord<X, Y>>
Sourcepub fn backend_coord(
&self,
coord: &(X::ValueType, Y::ValueType),
) -> BackendCoord
pub fn backend_coord( &self, coord: &(X::ValueType, Y::ValueType), ) -> BackendCoord
Maps the coordinate to the backend coordinate. This is typically used with an interactive chart.
Sourcepub fn draw_series<E, R, S>(
&mut self,
series: S,
) -> Result<&mut SeriesAnno<DB>, DrawingAreaErrorKind<DB::ErrorType>>where
for<'a> &'a E: PointCollection<'a, (X::ValueType, Y::ValueType)>,
E: Drawable<DB>,
R: Borrow<E>,
S: IntoIterator<Item = R>,
pub fn draw_series<E, R, S>(
&mut self,
series: S,
) -> Result<&mut SeriesAnno<DB>, DrawingAreaErrorKind<DB::ErrorType>>where
for<'a> &'a E: PointCollection<'a, (X::ValueType, Y::ValueType)>,
E: Drawable<DB>,
R: Borrow<E>,
S: IntoIterator<Item = R>,
Draw a data series. A data series in Plotters is abstracted as an iterator of elements
Auto Trait Implementations§
impl<DB, CT> Freeze for ChartContext<DB, CT>where
CT: Freeze,
impl<DB, CT> !RefUnwindSafe for ChartContext<DB, CT>
impl<DB, CT> !Send for ChartContext<DB, CT>
impl<DB, CT> !Sync for ChartContext<DB, CT>
impl<DB, CT> Unpin for ChartContext<DB, CT>
impl<DB, CT> !UnwindSafe for ChartContext<DB, CT>
Blanket Implementations§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more