forked from StudioInfinity/dyna3
Add data zoom controls to the diagnostics charts
This commit is contained in:
parent
de844cb63b
commit
af28e885bb
1 changed files with 5 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
use charming::{
|
use charming::{
|
||||||
Chart,
|
Chart,
|
||||||
WasmRenderer,
|
WasmRenderer,
|
||||||
component::{Axis, Grid},
|
component::{Axis, DataZoom, Grid},
|
||||||
element::AxisType,
|
element::AxisType,
|
||||||
series::{Line, Scatter},
|
series::{Line, Scatter},
|
||||||
};
|
};
|
||||||
|
@ -91,9 +91,10 @@ fn LossHistory() -> View {
|
||||||
}
|
}
|
||||||
let chart = Chart::new()
|
let chart = Chart::new()
|
||||||
.animation(false)
|
.animation(false)
|
||||||
|
.data_zoom(DataZoom::new().y_axis_index(0).right(40).start(0).end(100))
|
||||||
.x_axis(step_axis)
|
.x_axis(step_axis)
|
||||||
.y_axis(scaled_loss_axis)
|
.y_axis(scaled_loss_axis)
|
||||||
.grid(Grid::new().top(20).right(40).bottom(30).left(60))
|
.grid(Grid::new().top(20).right(80).bottom(30).left(60))
|
||||||
.series(scaled_loss_series);
|
.series(scaled_loss_series);
|
||||||
renderer.render(CONTAINER_ID, &chart).unwrap();
|
renderer.render(CONTAINER_ID, &chart).unwrap();
|
||||||
});
|
});
|
||||||
|
@ -143,9 +144,10 @@ fn SpectrumHistory() -> View {
|
||||||
}
|
}
|
||||||
let chart = Chart::new()
|
let chart = Chart::new()
|
||||||
.animation(false)
|
.animation(false)
|
||||||
|
.data_zoom(DataZoom::new().y_axis_index(0).right(40).start(0).end(100))
|
||||||
.x_axis(step_axis)
|
.x_axis(step_axis)
|
||||||
.y_axis(eigval_axis)
|
.y_axis(eigval_axis)
|
||||||
.grid(Grid::new().top(20).right(40).bottom(30).left(60))
|
.grid(Grid::new().top(20).right(80).bottom(30).left(60))
|
||||||
.series(eigval_series);
|
.series(eigval_series);
|
||||||
renderer.render(CONTAINER_ID, &chart).unwrap();
|
renderer.render(CONTAINER_ID, &chart).unwrap();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue