These are chat archives for oxyplot/oxyplot

20th
Sep 2017
Robert Bielik
@robiwano
Sep 20 2017 06:23
I'm trying to find a way to set the tracker color, as I'm doing a "dark" theme for OxyPlot. Ideas ?
VisualMelon
@VisualMelon
Sep 20 2017 18:03
@robiwano it doesn't appear to be possible with the existing API. However, that doesn't mean it is impossible. If you are using Winforms, you can fudge it with Label trackLabel = new Label { Parent = plotView, BackColor = Color.Maroon, AutoSize = true, Padding = new Padding(5) }; plotView.GetType().GetField("trackerLabel", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance).SetValue(plotView, trackLabel);. Likely similar hacks possible with WPF etc. which UI framework are you using? Consider creating an Issue for this, it seems a reasonable use-case.
Robert Bielik
@robiwano
Sep 20 2017 19:12
@VisualMelon I'm currently using WPF. I'll make an issue for this. Unless I can fork it and fix it myself, not sure where the tracker drawing resides... (being a .NET newbie)
VisualMelon
@VisualMelon
Sep 20 2017 19:22
Hmm, seems the WPF Tracker is lost whenever it is hidden, so it isn't so simple
Robert Bielik
@robiwano
Sep 20 2017 19:22
Still, there should be a way to set its default color, like Model.TrackerColor = ...
Like there is for axis colors etc.
VisualMelon
@VisualMelon
Sep 20 2017 19:23
The relevant code is in OxyPlot.Wpf\PlotBase.cs
Robert Bielik
@robiwano
Sep 20 2017 19:23
Ok, perfect! I'll have a look
VisualMelon
@VisualMelon
Sep 20 2017 19:23
Aye, it certainly seems a reasonable requirement, but clearly no one has need it yet
Looks like it is actually simple enough to do in WPF, you just need to add a tracker definition for the type of series (i.e. API support)
I don't normally use WPF for anything, but I'll give it a go
VisualMelon
@VisualMelon
Sep 20 2017 19:59
@beto-rodriguez the quick and easy way seems, in fact, to be to update the DefaultTrackerTemplate property of the WPF PlotView: just give it a ControlTemplate of a TrackerControl, and change that however you wish
If you are making a theme (like Themes\Generic.xaml) then just find the corresponding setters for the DefaultTrackerTemplate
The Keyed TrackerDefinitions allow you to have per-series Trackers, and that should presumably have better support than it currently does (e.g. in WinForms), which may warrant an Issue also