Trait charts::Chart[][src]

pub trait Chart<C, M, D, E> where
    E: Entity,
    C: CanvasContext,
    M: Display,
    D: Display + Copy
{ fn calculate_drawing_sizes(&self, ctx: &C);
fn update_channel(&self, index: usize);
fn draw_axes_and_grid(&self, ctx: &C);
fn draw_channels(&self, ctx: &C, percent: f64) -> bool;
fn draw_frame(&self, ctx: &C, time: Option<i64>);
fn create_entities(
        &self,
        channel_index: usize,
        start: usize,
        end: usize,
        color: Fill,
        highlight_color: Fill
    ) -> Vec<E>;
fn create_entity(
        &self,
        channel_index: usize,
        entity_index: usize,
        value: Option<D>,
        color: Fill,
        highlight_color: Fill
    ) -> E;
fn create_channels(&self, start: usize, end: usize);
fn get_tooltip_position(
        &self,
        tooltip_width: f64,
        tooltip_height: f64
    ) -> Point<f64>;
fn set_stream(&mut self, stream: DataStream<M, D>);
fn draw(&self, ctx: &C);
fn resize(&self, w: f64, h: f64); }

Required methods

fn calculate_drawing_sizes(&self, ctx: &C)[src]

Calculates various drawing sizes.

Overriding methods must call this method first to have [area] calculated.

fn update_channel(&self, index: usize)[src]

Updates the channel at index [index]. If [index] is null, updates all channel.

fn draw_axes_and_grid(&self, ctx: &C)[src]

Draws the axes and the grid.

fn draw_channels(&self, ctx: &C, percent: f64) -> bool[src]

Draws the channel given the current animation percent [percent].

If this method returns false, the animation is continued until [percent] reaches 1.0.

If this method returns true, the animation is stopped immediately. This is useful as there are cases where no animation is expected. In those cases, the overriding method will return true to stop the animation.

fn draw_frame(&self, ctx: &C, time: Option<i64>)[src]

Draws the current animation frame.

If [time] is null, draws the last frame (i.e. no animation).

fn create_entities(
    &self,
    channel_index: usize,
    start: usize,
    end: usize,
    color: Fill,
    highlight_color: Fill
) -> Vec<E>
[src]

fn create_entity(
    &self,
    channel_index: usize,
    entity_index: usize,
    value: Option<D>,
    color: Fill,
    highlight_color: Fill
) -> E
[src]

fn create_channels(&self, start: usize, end: usize)[src]

fn get_tooltip_position(
    &self,
    tooltip_width: f64,
    tooltip_height: f64
) -> Point<f64>
[src]

Returns the position of the tooltip based on [focused_entity_index].

fn set_stream(&mut self, stream: DataStream<M, D>)[src]

fn draw(&self, ctx: &C)[src]

called to redraw using non_eq pattern

fn resize(&self, w: f64, h: f64)[src]

Resizes the chart to fit the new size of the container. w = container.clientWidth; h = container.clientHeight;

Loading content...

Implementors

impl<C, E, M, D, O> Chart<C, M, D, E> for BaseChart<C, E, M, D, O> where
    C: CanvasContext,
    E: Entity,
    M: Display,
    D: Display + Copy,
    O: BaseOption
[src]

fn calculate_drawing_sizes(&self, ctx: &C)[src]

Calculates various drawing sizes.

Overriding methods must call this method first to have [area] calculated.

fn draw(&self, ctx: &C)[src]

Draws the chart given a data table [dataTable] and an optional set of options [options].

fn resize(&self, w: f64, h: f64)[src]

Resizes just only change size state for chart and do not resize the container/canvas.

fn draw_axes_and_grid(&self, ctx: &C)[src]

Draws the axes and the grid.

fn update_channel(&self, _: usize)[src]

Updates the channel at index [index]. If [index] is null, updates all channel.

fn draw_frame(&self, ctx: &C, time: Option<i64>)[src]

Draws the current animation frame.

If [time] is null, draws the last frame (i.e. no animation).

fn draw_channels(&self, ctx: &C, percent: f64) -> bool[src]

Draws the channel given the current animation percent [percent].

If this method returns false, the animation is continued until [percent] reaches 1.0.

If this method returns true, the animation is stopped immediately. This is useful as there are cases where no animation is expected. In those cases, the overriding method will return true to stop the animation.

impl<C, M, D> Chart<C, M, D, BarEntity<D>> for BarChart<C, M, D> where
    C: CanvasContext,
    M: Display,
    D: Display + Copy + Into<f64> + Ord + Default
[src]

fn draw_axes_and_grid(&self, ctx: &C)[src]

Draws the axes and the grid.

fn draw_frame(&self, ctx: &C, time: Option<i64>)[src]

Draws the current animation frame.

If [time] is null, draws the last frame (i.e. no animation).

impl<C, M, D> Chart<C, M, D, GaugeEntity<D>> for GaugeChart<C, M, D> where
    C: CanvasContext,
    M: Display,
    D: Display + Copy + Into<f64> + Ord + Default
[src]

fn draw_axes_and_grid(&self, ctx: &C)[src]

Draws the axes and the grid.

fn draw_frame(&self, ctx: &C, time: Option<i64>)[src]

Draws the current animation frame.

If [time] is null, draws the last frame (i.e. no animation).

impl<C, M, D> Chart<C, M, D, LinePoint<D>> for LineChart<C, M, D> where
    C: CanvasContext,
    M: Display,
    D: Display + Copy + Into<f64> + Ord + Default
[src]

fn draw_axes_and_grid(&self, ctx: &C)[src]

Draws the axes and the grid.

fn draw_frame(&self, ctx: &C, time: Option<i64>)[src]

Draws the current animation frame.

If [time] is null, draws the last frame (i.e. no animation).

impl<C, M, D> Chart<C, M, D, PieEntity<D>> for PieChart<C, M, D> where
    C: CanvasContext,
    M: Display,
    D: Display + Copy + Into<f64> + Ord + Default
[src]

fn draw_axes_and_grid(&self, ctx: &C)[src]

Draws the axes and the grid.

fn draw_frame(&self, ctx: &C, time: Option<i64>)[src]

Draws the current animation frame.

If [time] is null, draws the last frame (i.e. no animation).

impl<C, M, D> Chart<C, M, D, PolarPoint<D>> for RadarChart<C, M, D> where
    C: CanvasContext,
    M: Display,
    D: Display + Copy + Into<f64> + Ord + Default
[src]

fn draw_frame(&self, ctx: &C, time: Option<i64>)[src]

Draws the current animation frame.

If [time] is null, draws the last frame (i.e. no animation).

Loading content...