Skip to content

Commit 747cfff

Browse files
committed
Improve the surface series
1 parent 2215a50 commit 747cfff

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

examples/wasm-demo/src/plot3d.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ pub fn draw(canvas: HtmlCanvasElement, pitch: f64, yaw: f64) -> DrawResult<()> {
2424

2525
chart.configure_axes().draw()?;
2626

27-
chart.draw_series(SurfaceSeries::<f64, _, f64>::new(
28-
x_axis.values(),
29-
z_axis.values(),
30-
|&x, &z| (x * x + z * z).cos(),
31-
&BLUE.mix(0.2),
32-
))?;
27+
chart.draw_series(
28+
SurfaceSeries::xoz(x_axis.values(), z_axis.values(), |x:f64, z:f64| {
29+
(x * x + z * z).cos()
30+
})
31+
.style(&BLUE.mix(0.2)),
32+
)?;
3333

3434
chart.draw_series(LineSeries::new(
3535
(-100..100)

0 commit comments

Comments
 (0)