Struct egui_plotter::Chart
source · pub struct Chart { /* private fields */ }
Expand description
Allows users to drag, rotate, and zoom in/out on your plots.
Usage
Charts are designed to be easy to implement and use, while simultaniously being powerful enough for your application. You can manipulate the following properties of a chart to get the effects you want:
builder_cb
- Callback used to populate the chart. Is provided a DrawingArea and the chart’sdata
.mouse
- Mouse configuration. Configure how you wish the mouse to affect/manipulate the chart.data
- A Box of data of any type to be stored with the chart. Provided so that you can modify data without having to specify a new callback during runtime. For example,examples/parachart.rs
uses it to store the range so it can be changed during runtime.
Examples
See examples/3dchart.rs
and examples/parachart.rs
for examples of usage.
Implementations§
source§impl Chart
impl Chart
sourcepub fn set_mouse(&mut self, mouse: MouseConfig)
pub fn set_mouse(&mut self, mouse: MouseConfig)
Enable or disable mouse controls.
sourcepub fn mouse(self, mouse: MouseConfig) -> Self
pub fn mouse(self, mouse: MouseConfig) -> Self
Enable or disable mouse controls. Consumes self.
sourcepub fn set_builder_cb(
&mut self,
builder_cb: Box<dyn FnMut(&mut DrawingArea<EguiBackend<'_>, Shift>, &Transform, &Option<Box<dyn Any>>)>
)
pub fn set_builder_cb( &mut self, builder_cb: Box<dyn FnMut(&mut DrawingArea<EguiBackend<'_>, Shift>, &Transform, &Option<Box<dyn Any>>)> )
Set the builder callback.
sourcepub fn builder_cb(
self,
builder_cb: Box<dyn FnMut(&mut DrawingArea<EguiBackend<'_>, Shift>, &Transform, &Option<Box<dyn Any>>)>
) -> Self
pub fn builder_cb( self, builder_cb: Box<dyn FnMut(&mut DrawingArea<EguiBackend<'_>, Shift>, &Transform, &Option<Box<dyn Any>>)> ) -> Self
Set the builder callback. Consumes self.
Auto Trait Implementations§
impl !RefUnwindSafe for Chart
impl !Send for Chart
impl !Sync for Chart
impl Unpin for Chart
impl !UnwindSafe for Chart
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