I am trying to configure the TrackerFormatString in Oxyplot, so that a particular string is shown for specific values. My code looks something like this:
private void addSeriesToGraph(KeyValuePair<Tuple<string, List<KeyValuePair<long, string>>>, ConcurrentStack<DataPoint>> series)
{
Graph.Series.Add(
new LineSeries()
{
TrackerFormatString = "{0}\n{1}: {2:hh\\:mm\\:ss\\.fff}\nY: {4}"
+ ((series.Key.Item2.Count > 0)? " (" + series.Key.Item2.First(x => x.Key.ToString() == "{4}").Value + ")" : ""),
Title = series.Key.Item1,
ItemsSource = series.Value,
}
);
}
My Problem is that "{4}" in my conditional statement isn't interpreted like the first one: it should contain the Y-Value of the current DataPoint but is interpreted as literal {4}
.
Does anyone know how to achieve what I am trying to do?