This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi There, On the scatter series, I can set the ToolTip binding for symbols and it works fine. Basic idea for my binding is to use Grid and set the tooltips for the grid and the ToolTip binds to X and Y property for my data objects with converter to show tooltip as (X, Y), i.e. (1.5, 5.5). but there are annoying binding error as: BindingExpression path error: 'Y' property not found on 'object' ''LegendItem' (HashCode=64777010)'. BindingExpression:Path=Y; DataItem='LegendItem' (HashCode=64777010); target element is 'Grid' (Name=''); target property is 'ToolTip' (type 'Object') How to fix this binding error? Thanks Gordon |
|
|
Hello Gordon This type of error can be safely ignored and shouldn't impact the performance. There are a couple of ways to get rid of it though. The issue is caused because the legend icon templates use the same SymbolStyle as what the charts use. This is mainly so the legend icon can display the same shape as the symbols displayed in the chart. The downside of this is that it also uses any bindings that you put on the symbol style. This can be a problem such as in your case because the legend icon does not have a data value as the DataContext. The best way to resolve this would be to use the ToolTipBinding property on the ScatterSeries instead of manually putting the tooltip in the style. You can set the ToolTipBinding to be a standard binding with no property path, and then use a converter that takes in the whole data value and returns the string containing both the X and Y values. Another way to fix this would be to set the LegendIconTemplate to be a template that does not use the SymbolStyle. The template would need to include the shape of the symbol so it looks correct in the legend. Though using this approach you could make the legend icons look like what ever you want. Overall this would be inconvenient if you have many different shapes. And another way would be to continue doing what you've done now, but instead of binding to X and Y individually, you could use a binding with no path, and use a converter that takes in the whole value, checks that it is the appropriate data value type, and then return the string containing both the X and Y values. Let me know if you need further help with any of these approaches. Jason Fauchelle |
|