SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

I am currently evaluating the use of SciChart for an application we are developing that requires real-time data graphing. The application uses a TabControl, with different usercontrols in each TabItem .

So I am attempting to replicate the RealTimeCursor example inside a tabItem of a Tabcontrol. The problem I am having is with the rollover legend. Basically the rollover legend appears only if the control is in the first TabItem but not if in the second or subsequent tabItem. Everything else appears to work correctly.

The problem is that the legend does not appear in the “graph” tab – unless the graph tab is the first tab, i.e. – legend appears in the Graph tab as it the first tab (“Test” is the second (empty) tab).

    <TabControl>
        <TabItem Header="Graph">
            <local:RealTimeCursors   x:Name="RealTimeChart"/>
        </TabItem>
        <TabItem Header="Test"></TabItem>
    </TabControl>

but legend does not appear if “Graph” tab is the second tab (now “Test” is the first tab) i.e.

    <TabControl>
        <TabItem Header="Test"></TabItem>
        <TabItem Header="Graph">
            <local:RealTimeCursors   x:Name="RealTimeChart"/>
        </TabItem>
    </TabControl>

As I want to include one graph inside a tabcontrol – and it is not the first tab – the legend is not appearing. I do not know how to fix this. Can you give me some pointers on how I should modify the RealTimeCursors example to work inside a tabcontrol? Thanks!

Attachments
  • You must to post comments
0
0

Hi Steve,

Thanks for the sample. I tried it again, and got the following message in the Output window:

System.Windows.Data Error: 4 : Cannot find source for binding with reference ‘ElementName=rolloverModifier’. BindingExpression:(no path); DataItem=null; target element is ‘ItemsControl’ (Name=”); target property is ‘DataContext’ (type ‘Object’)

I’m not sure why this happens, but there is an easy workaround: the code does work if you put the RolloverModifier into Resources section as a static resource:

<UserControl.Resources>

    <s:RolloverModifier x:Key="rolloverModifier" ShowAxisLabels="False" UseInterpolation="True" />
</UserControl.Resources>

<s:SciChartSurface x:Name="sciChartSurface" ChartModifier="{StaticResource rolloverModifier}" …/>

<ItemsControl DataContext="{StaticResource rolloverModifier}">

Hope this helps!

Best regards,
Yuriy

  • steve71
    Many thanks for your quick reply Yuriy. Yes I got the same error. I'll give your solution a tryCheers Steve
  • steve71
    Yes, now working, thanks again :-D
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.