Commit Graph
4 Commits
Author SHA1 Message Date
JMR-dev 947069eeee code review fixes 2026-06-10 23:31:36 -05:00
JMR-devandCopilot 73a81138a7 Add plot legend with floating top-right overlay
Renders a small panel inside the plot showing each visible series as [color swatch] [sensor title] [latest value + unit]. Panel width fits the longest sensor name and redraws when sensors are added or removed from the plot (RefreshPlotSeries already fires PlotInvalidated). Falls back to ellipsizing only if the label column would push the panel past the plot bounds. Capped at 12 rows with a +N more footer; auto-hides when plot pane is narrower than 200px. Theme-aware translucent background + border match the plot frame.

Persisted as showPlotLegend (default true) and toggleable from View menu and plot context menu. The View menu item is hidden when ShowPlot is off, but the setting itself is preserved across plot enable/disable and app restarts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-02 14:26:11 -05:00
JMR-devandCopilot 35f730c89a Host PlotView in MainWindow.xaml (Phase 5b step 5)
PlotView now has a parameterless ctor + AttachViewModel(vm) so it can be instantiated by the XAML loader. The context flyout is built lazily in AttachViewModel since it captures live ViewModel state. Class is now public sealed (XAML codegen requirement). MainWindow's BuildPlotPane is gone; the plot pane (toolbar + <controls:PlotView x:Name=PlotControl/>) lives in XAML and the ctor just calls PlotControl.AttachViewModel(ViewModel).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-02 13:36:20 -05:00
JMR-devandCopilot 888c2cd852 Extract PlotView control from MainWindow
Move ~460 lines of imperative Canvas plot rendering (draw helpers, value/time axes, zoom state, context flyout, wheel handler, color theming, and the PlotBounds/PlotAxisLayout/PlotSeriesSample records) out of MainWindow into a new Controls/PlotView : Grid that owns its own Canvas. PlotWindow now hosts a PlotView instead of a raw Canvas; the shared rendering path collapses to PlotView.Redraw().

MainWindow shrinks from 2014 to 1445 lines; the inline plot pane and the windowed plot now share a single code path. Public API on PlotView: Redraw(), Clear(), ResetZoom(), ApplyTheme(AppThemeMode).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-02 11:51:46 -05:00