LegendChart

Trait LegendChart 

Source
pub trait LegendChart<C: PixelColor>: Chart<C> {
    type Legend;

    // Required methods
    fn set_legend(&mut self, legend: Option<Self::Legend>);
    fn legend(&self) -> Option<&Self::Legend>;
    fn legend_size(&self) -> Size;
}
Expand description

Trait for charts that support legends

Required Associated Types§

Source

type Legend

Legend configuration type

Required Methods§

Source

fn set_legend(&mut self, legend: Option<Self::Legend>)

Set the legend configuration

§Arguments
  • legend - Legend configuration
Source

fn legend(&self) -> Option<&Self::Legend>

Get the legend configuration

Source

fn legend_size(&self) -> Size

Calculate the space required for the legend

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§