+2
Wird überprüft
WPF tracker multiple value
Hi all,
Currently, I've two line series for one plot model. I want to know if it's possible to have a tracker with multiple value like this example :
Best regards.
Currently, I've two line series for one plot model. I want to know if it's possible to have a tracker with multiple value like this example :
Best regards.
Customer support service by UserEcho
Please add a new feature or example request in the issues at GitHub!
<oxy:Plot x:Name="graph" Title="test">
<ControlTemplate>
<oxy:TrackerControl Position="{Binding Position}" LineExtents="{Binding PlotModel.PlotArea}" BorderBrush="{Binding Series.ActualColor, Converter={StaticResource OxyColorConverter}}" BorderThickness="3">
<oxy:TrackerControl.Content>
<TextBlock Text="{Binding}" Margin="7" />
</oxy:TrackerControl.Content>
</oxy:TrackerControl>
</ControlTemplate>
</oxy:PlotView.DefaultTrackerTemplate>
and my C# code :
private void GeneCourbe(List<PointsMesure> mesureList, String mesureName)
{
var valueAxis = new LinearAxis(AxisPosition.Left, 0) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, Title = "Mesure " + mesureName };
valueAxis.AxisDistance = 0;
valueAxis.IsZoomEnabled = true;
valueAxis.IsPanEnabled = true;
plotModel.Axes.Add(valueAxis);
var line = new LineSeries
{
MarkerSize = 3,
// MarkerStroke = colors[data.Key],
// MarkerType = markerTypes[data.Key],
CanTrackerInterpolatePoints = false,
Smooth = false,
line.TrackerFormatString = " {0} " + Environment.NewLine + "{1}: {2} " + Environment.NewLine + "{3}: {4} ";
foreach (PointsMesure pm in mesureList)
{
valueAxis.Key = "Axe " + mesureName;
line.YAxisKey = "Axe " + mesureName;
plotModel.Series.Add(line);
graph.InvalidatePlot(true);
graph.Model = plotModel;
}
At each call of the function "GeneCourbe", I create a new lineseries. It will be powerful if I can have one tracker for all LineSeries.
This feature could also be covered by Issue #49
See http://www.codeproject.com/Tips/1075272/Multi-line-Tracker-for-OxyPlot
Nice!