From 470d08be4832e80fadfd613d5c4448479b7dc0c5 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Mon, 29 Jan 2024 12:46:14 -0500 Subject: [PATCH] Fix timeseries legend control (#4941) ### What - Resolves: https://github.com/rerun-io/rerun/issues/4905 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/4941/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/4941/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/4941/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/4941) - [Docs preview](https://rerun.io/preview/fb4d418b498342b8b660669cb3a1455ffcc53948/docs) - [Examples preview](https://rerun.io/preview/fb4d418b498342b8b660669cb3a1455ffcc53948/examples) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --- crates/re_space_view_time_series/src/space_view_class.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/re_space_view_time_series/src/space_view_class.rs b/crates/re_space_view_time_series/src/space_view_class.rs index 0190383f8863..dc7696bb6b3f 100644 --- a/crates/re_space_view_time_series/src/space_view_class.rs +++ b/crates/re_space_view_time_series/src/space_view_class.rs @@ -343,7 +343,9 @@ impl SpaceViewClass for TimeSeriesSpaceView { }); if legend.visible { - plot = plot.legend(Legend::default().position(DEFAULT_LEGEND_CORNER)); + plot = plot.legend( + Legend::default().position(legend.corner().unwrap_or(DEFAULT_LEGEND_CORNER)), + ); } if timeline.typ() == TimeType::Time {