plotters icon indicating copy to clipboard operation
plotters copied to clipboard

For the DualCoordChartContext add borrow_secondary_mut function

Open bennysj opened this issue 2 months ago • 1 comments

The function borrow_secondary function does not return a mutable reference. It would be useful if it actually would be possible to get a &mut reference to the secondary context. Implement a new function that actually return a &mut reference to the secondary context.

For example to write a generic draw function:

    fn draw_chart_series<DB>(
        chart: &mut ChartContext<'_, DB, Cartesian2d<RangedCoordf32, RangedCoordf32>>,
        data_series: &ModelRc<XYData>,
    ) where
        DB: DrawingBackend,
    {
        // draw the chart series for both primary and secondary
   }

bennysj avatar Oct 24 '25 12:10 bennysj

This looks useful.

nielsle avatar Dec 07 '25 11:12 nielsle