pub struct ChartContext<'a, DB, CT> where
    DB: DrawingBackend,
    CT: CoordTranslate
{ /* private fields */ }
Expand description

The context of the chart. This is the core object of Plotters. Any plot/chart is abstracted as this type, and any data series can be placed to the chart context.

Implementations

Initialize a mesh configuration object and mesh drawing can be finalized by calling the function MeshStyle::draw.

Convert the chart context into an closure that can be used for coordinate translation

Configure the styles for drawing series labels in the chart

Get a reference of underlying plotting area

Cast the reference to a chart context to a reference to underlying coordinate specification.

Draw a data series. A data series in Plotters is abstracted as an iterator of elements

Get the range of X axis

Get range of the Y axis

Maps the coordinate to the backend coordinate. This is typically used with an interactive chart.

Convert this chart context into a dual axis chart context and attach a second coordinate spec on the chart context. For more detailed information, see documentation for struct DualCoordChartContext

  • x_coord: The coordinate spec for the X axis
  • y_coord: The coordinate spec for the Y axis
  • returns The newly created dual spec chart context

Override the 3D projection matrix. This function allows to override the default projection matrix.

  • pf: A function that takes the default projection matrix configuration and returns the projection matrix. This function will allow you to adjust the pitch, yaw angle and the centeral point of the projection, etc. You can also build a projection matrix which is not relies on the default configuration as well.

Convert a chart context into a chart state, by doing so, the chart context is consumed and a saved chart state is created for later use. This is typically used in incrmental rendering. See documentation of ChartState for more detailed example.

Convert the chart context into a sharable chart state. Normally a chart state can not be clone, since the coordinate spec may not be able to be cloned. In this case, we can use an Arc get the coordinate wrapped thus the state can be cloned and shared by multiple chart context

Make the chart context, do not consume the chart context and clone the coordinate spec

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.