Pre loader

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

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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:
https://stackoverflow.com/questions/48916897/how-to-make-wrapper-for-datatype-datacontext-in-wpf
but still no one helped me.
I don’t know why this is so hard question. Hope here I’ll find answer.

Version
5.1.0.11243
  • You must to post comments
0
0

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.

  • You must to post comments
0
0

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,
Andrew

  • 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