pub struct ChartRenderer { /* private fields */ }Expand description
Turns a chart’s option and layout into a display list.
The renderer is the only place that knows how a chart is put together: the background, the grid, the axes, the series, the title, and the legend. It writes into a display list, which the backends replay — so a new backend never has to know what a chart looks like.
The renderer is public so that a benchmark — or a server-side render — can measure the cost of a layout without a canvas.
Implementations§
Source§impl ChartRenderer
Inherent implementation of ChartRenderer.
impl ChartRenderer
Inherent implementation of ChartRenderer.
Sourcepub fn build(
&mut self,
list: &mut DisplayList,
option: &ChartOption,
layout: &ChartLayout,
)
pub fn build( &mut self, list: &mut DisplayList, option: &ChartOption, layout: &ChartLayout, )
Builds the display list of a chart.
§Arguments
&mut DisplayList- Mutable reference to aDisplayList(mutated in place).&ChartOption- Shared reference to aChartOption.&ChartLayout- Shared reference to aChartLayout.
Sourcepub fn build_with_tooltip(
&mut self,
list: &mut DisplayList,
option: &ChartOption,
layout: &ChartLayout,
tooltip: Option<&TooltipState>,
)
pub fn build_with_tooltip( &mut self, list: &mut DisplayList, option: &ChartOption, layout: &ChartLayout, tooltip: Option<&TooltipState>, )
Builds the display list of a chart, with a tooltip on top.
§Arguments
&mut DisplayList- Mutable reference to aDisplayList(mutated in place).&ChartOption- Shared reference to aChartOption.&ChartLayout- Shared reference to aChartLayout.Option<&TooltipState>- AOption<&TooltipState>parameter.
Trait Implementations§
Source§impl Clone for ChartRenderer
impl Clone for ChartRenderer
Source§impl Debug for ChartRenderer
impl Debug for ChartRenderer
Source§impl Default for ChartRenderer
Default construction for ChartRenderer.
impl Default for ChartRenderer
Default construction for ChartRenderer.
Auto Trait Implementations§
impl Freeze for ChartRenderer
impl RefUnwindSafe for ChartRenderer
impl Send for ChartRenderer
impl Sync for ChartRenderer
impl Unpin for ChartRenderer
impl UnsafeUnpin for ChartRenderer
impl UnwindSafe for ChartRenderer
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