SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
This question is more about WPF, but I can’t find any information how to do it.
I need to compute some information and write it in TextBlock.
Ideally If I could wrap OhlcSeriesInfo into my wrapper class. Then set this wrapper as DataContext and binding to its properties.
I rised this question on stack overflow:
but still no one helped me.
I don’t know why this is so hard question. Hope here I’ll find answer.
Your question on stack overflow is quite vague, I’m not surprised it doesn’t have any answers. Even I don’t know what you mean!
But your question here makes a little more sense. What you want to do is have a custom class as datacontext for the TooltipModifier in SciChart.
That we can do.
Changing the Tooltip DataContext
The TooltipModifier features the ability to easily change the DataContext (or viewmodel) for Tooltips, via the
In the Examples > 2D Charts > Tooltips and Hit Test > Using TooltipModifier Tooltips example the
TooltipModifier.TooltipLabelDataContextSelector property is bound to a ViewModel property
allowing you to wrap extra info around the SeriesInfo provided by SciChart.
This lets you inject extra information into the tooltips easily.
Let me know if that helps,
Thank you. I tried to use TooltipLabelDataContextSelector and I have some misunderstandings.
1) As I understand I can combine CursorModifier and TooltipModifier. Do I do it right? I.e. should I CursorModifier.ShowTooltip set to False?
<s:CursorModifier ShowTooltip="False" ShowAxisLabels="True" /> <s:TooltipModifier ShowTooltipOn="Always" />
2) Does TooltipModifier.ShowAxisLabels not work? It has no effect.
3) Am I forced to write in custom tooltip class properties: Color Stroke and Brush Fill?
Now I’m getting error: BindingExpression path error: ‘Stroke/Fill’ property not found on ‘object’ ”TooltipInfo.
4) Why does CursorModifier not have such property? I could do with one CursorModifier.
5) I think this API looks not good. I’d prefer to do this only via WPF.
Maybe is there a way to convert OhlcSeriesInfo (DataContext) to my custom (wrapper) class?
If I could pass current DataContext to ObjectDataProvider’s constructor then I could convert via only XAML.
Please login first to submit.