MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / new

Method new

examples/scrolling_plot.rs:72–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 }
71
72 fn new() -> Self {
73 let x = 0.0f64;
74 let series = Series::markers_only(vec![[x, (x * 0.5).sin()]], MarkerStyle::ring(10.0))
75 .with_label("scrolling")
76 .with_color(Color::WHITE);
77 let hline = HLine::new(0.0);
78 let fill = Fill::new(hline.id, series.id);
79 Self {
80 series_id: series.id,
81 widget: PlotWidgetBuilder::new()
82 .with_autoscale_on_updates(true)
83 .add_series(series)
84 .add_hline(hline)
85 .add_fill(fill)
86 .build()
87 .unwrap(),
88 x,
89 last_tick: Instant::now(),
90 }
91 }
92}

Callers

nothing calls this directly

Calls 8

buildMethod · 0.80
newFunction · 0.70
with_colorMethod · 0.45
with_labelMethod · 0.45
add_fillMethod · 0.45
add_hlineMethod · 0.45
add_seriesMethod · 0.45

Tested by

no test coverage detected