Expand description

The Plotters Iced backend, for both native and wasm applications(not working for v0.3).

This is an implementation of a Iced backend for Plotters.

This backend has been optimized as for speed. Note that some specific plotting features supported in the Bitmap backend may not be implemented there, though.

See the examples for more details.

How to install?

Include plotters-iced in your Cargo.toml dependencies:

[dependencies]
plotters-iced = "0.3"
iced = { version = "0.4", features = ["canvas", "tokio"] }
plotters="0.3"

Showcase

CPU Monitor Example

WASM Example

Example

struct MyChart;
impl Chart<Message> for MyChart {
   fn build_chart<DB:DrawingBackend>(&self, builder: ChartBuilder<DB>) {
      //build your chart here, please refer to plotters for more details
   }
}

impl MyChart {
   fn view(&mut self)->Element<Message> {
      ChartWidget::new(self)
      .width(Length::Unit(200))
            .height(Length::Unit(200))
            .into()
   }
}

See the examples for more details.

Re-exports

pub extern crate plotters_backend;
pub use native::ChartWidget;
pub use plotters::chart::ChartBuilder;
pub use plotters::drawing::DrawingArea;
pub use plotters_backend::DrawingBackend;

Modules

native widgets

Enums

Indicates that some error occurred within the Iced backend

Traits

Chart View Model

Type Definitions

Signature for the callback that ChartWidget can trigger when a mouse event happens inside its layout. Return None if the mouse event is not being handled by this callback.