Pre loader

How to print in Tooltip percentage between Open\Close and High\Low?


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.

  • You must to post comments

Hi Denis,

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.

See the TooltipModifier Documentation.

Changing the Tooltip DataContext
The TooltipModifier features the ability to easily change the DataContext (or viewmodel) for Tooltips, via the
TooltipModifier.TooltipLabelDataContextSelector property.

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,

Best regards,

  • You must to post comments

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?

           ShowTooltip="False" ShowAxisLabels="True" />

            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.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies