I create series on the fly based on the data loaded. Something like this:
foreach (var entry in distinctSeries)
{
ScatterSeries ss = newScatterSeries();
ss.XMemberPath = "XVal";
ss.YMemberPath = "YVal";
//etc.
xamDataChart1.Series.Add(ss);
}
I want to have a custom tooltip based on some properties of the points in the series.
The underlying data looks something like this:
public class MyDataPoint
public Int64 XVal { get; set; }
public int YVal {get; set; }
public string SomeOtherDataPointValue { get; set; }
// other stuff
public string MyToolTip
get { return XVal.ToString() + "my tooltip stuff goes here" + SomeOtherDataPointValue();}
//etc
I guess my question is how do I specify when I'm creating these series in the code behind that I want to use this MyToolTip property as the tooltip that pops up for each point? I'm wanting to do something like:
ss.ToolTip = // and then something that indicates I want to bind each point's tooltip to the MyToolTip property of that point
Make sense?
How would I do that?
Hi,
I'm winging this a bit so let me know if this doesnt compile or work:
TextBlock tb = new TextBlock(); tb.SetBinding(TextBlock.TextProperty, new Binding("Item.MyToolTip")); ss.Tooltip = tb;
Hope this helps!
-Graham
Yes, that works nicely. I appreciate your help with that.
Regards,
Matt