(
&mut self,
root: &DrawingArea<GpuiBackend, Shift>,
)
| 61 | |
| 62 | impl PlottersChart for AreaChart { |
| 63 | fn plot( |
| 64 | &mut self, |
| 65 | root: &DrawingArea<GpuiBackend, Shift>, |
| 66 | ) -> Result<(), plotters_gpui::DrawingErrorKind> { |
| 67 | let mut chart = ChartBuilder::on(root) |
| 68 | .set_label_area_size(LabelAreaPosition::Left, 60) |
| 69 | .set_label_area_size(LabelAreaPosition::Bottom, 60) |
| 70 | .caption("Area Chart Demo", ("sans-serif", 40)) |
| 71 | .build_cartesian_2d(0..(self.data.len() - 1), 0.0..1500.0) |
| 72 | .unwrap(); |
| 73 | |
| 74 | chart |
| 75 | .configure_mesh() |
| 76 | .disable_x_mesh() |
| 77 | .disable_y_mesh() |
| 78 | .draw() |
| 79 | .unwrap(); |
| 80 | |
| 81 | chart |
| 82 | .draw_series( |
| 83 | AreaSeries::new( |
| 84 | (0..).zip(self.data.iter()).map(|(x, y)| (x, *y)), |
| 85 | 0.0, |
| 86 | RED.mix(0.2), |
| 87 | ) |
| 88 | .border_style(RED), |
| 89 | ) |
| 90 | .unwrap(); |
| 91 | |
| 92 | Ok(()) |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | fn main_viewer(cx: &mut App) -> MainViewer { |
nothing calls this directly
no outgoing calls
no test coverage detected