WPF sample: chart UX overhaul (pan/zoom, candle sizing) and restyle#35
Open
toolsche wants to merge 2 commits into
Open
WPF sample: chart UX overhaul (pan/zoom, candle sizing) and restyle#35toolsche wants to merge 2 commits into
toolsche wants to merge 2 commits into
Conversation
- Chart.cs: format OHLC values with InvariantCulture. They were interpolated with the current culture, so on cultures using ',' as the decimal separator (e.g. German) createChart received invalid JavaScript and the chart stayed blank. - WPF.Sample.csproj: add CopyToOutputDirectory for hammer.js and chartjs-plugin-zoom.min.js. They are referenced by chart.html but only had CopyToPublishDirectory, so they were missing from a normal build output. - ChartingService.cs: load chart.html via a proper file:// URI resolved from the app directory (AppContext.BaseDirectory) instead of Environment.CurrentDirectory plus a raw Windows path. - ShellViewModel.cs: de-duplicate conversion-symbol requests on account change. Each distinct quote asset is now requested once instead of once per symbol, cutting hundreds of sequential round-trips and bringing account load from minutes to seconds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
chart.html rewritten around data windowing: the financial plugin sizes candles from the number of points in the dataset, so it kept only a fixed-size window of candles on the chart while holding the full history in JS. This keeps candles a readable, consistent width at any history depth. Drag pans through time and price, dragging over the price axis scales it, double-click restores auto-fit, and the wheel zooms the time axis. The unreliable Hammer-based zoom plugin is no longer used. The price axis auto-fits the visible candles. - App.xaml/App.xaml.cs: switch the accent theme to Cobalt and initialize CefSharp with the GPU disabled (CefSharp 90 is unstable with hardware acceleration on modern Windows). - ShellView.xaml: larger, centered default window and a styled splitter. - ApiConfigurationView.xaml: roomier dialog with field watermarks. Stacked on the bug-fix PR; that one is needed for the chart to render on non-English locales, so the diff will shrink once it merges. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UX and styling improvements for the WPF sample (
Trading.UI.Sample).Chart rewrite around data windowing
The
chartjs-chart-financialcandlestick sizes candle width from the number of points in the dataset, so loading thousands of bars and showing a subset made candles collapse into sub-pixel sticks.chart.htmlnow keeps the full history in JS and feeds only a fixed-size window (~100 candles, clamped 25–200) to the chart, so candles stay a readable, consistent width at any history depth.Interaction (the Hammer-based zoom plugin was unreliable with this beta Chart.js build and is no longer used):
Styling
These are more opinionated than #34 — happy to adjust or drop any part.
🤖 Generated with Claude Code