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

1 vote
6k views

Firstly we have an issue at the moment using the high speed renderer. We have a window containing a tab control with several tabs. One of the tabs has several charts and the other tabs contain grid controls with 100’s to 1000’s of rows. The issue seems to be when re-sizing the window with the chart tab visible.
The charts hang on redrawing. When the tabs with grids are selected re-sizing is normal and fast. Only when switching to the tab with charts does it hang.

It also seems that separate charts in different windows also become affected when re-sizing them too. Seems they all share the same renderer instance?

I’ve profiled the re-sizing in visual studio and attached a screenshot of the method calls. Seems a lot of time is taken in RenderSurfaceSizeChanged and it’s children

When I don’t populate the grids, the re-sizing is better but there is still a bit of a hang.
Here is the xaml I’m using for each chart control

   <s:SciChartSurface x:Name="Chart"
                           ChartTitle="{Binding ChartTitle}" 
                           FontSize="14"
                           FontWeight="Bold"
                           RenderPriority="Normal"
                           Background="WhiteSmoke"

                           s:ThemeManager.Theme="ExpressionDark">

            <s:SciChartSurface.RenderableSeries>
                <s:FastColumnRenderableSeries x:Name="ChartDataSeries" 
                                             >
                </s:FastColumnRenderableSeries>
            </s:SciChartSurface.RenderableSeries>
            <s:SciChartSurface.XAxis>
                <s:CategoryDateTimeAxis Style="{StaticResource AxisStyle}" DrawMinorTicks="False" DrawMajorTicks="False" DrawMinorGridLines="False"></s:CategoryDateTimeAxis>
            </s:SciChartSurface.XAxis>
            <s:SciChartSurface.YAxis>
                <s:NumericAxis Style="{StaticResource AxisStyle}" LabelProvider="{StaticResource QuantityLabelProvider}"  DrawMinorGridLines="False" DrawMajorTicks="False" DrawMinorTicks="False"  />
            </s:SciChartSurface.YAxis>
            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RolloverModifier ReceiveHandledEvents="True"/>
                    <s:CursorModifier ReceiveHandledEvents="True" ShowAxisLabels="False" ShowTooltip="False" />
                    <s:RubberBandXyZoomModifier ReceiveHandledEvents="True" IsEnabled="True" ExecuteOn="MouseLeftButton" IsXAxisOnly="True"/>
                    <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
                    <s:ZoomPanModifier ReceiveHandledEvents="True" x:Name="ZoomPanModifier" IsEnabled="True" ExecuteOn="MouseMiddleButton"/>
                    <s:MouseWheelZoomModifier ReceiveHandledEvents="True" ActionType="Zoom" XyDirection="XYDirection"></s:MouseWheelZoomModifier>
                    <s:YAxisDragModifier IsEnabled="True" />
                    <s:XAxisDragModifier IsEnabled="True" />
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>
        </s:SciChartSurface>

We tried using the DX10 surface and this fixed the issue above, but it seems it’s not working for at least candlestick charts and column charts – the very charts we need. This can be seen by using the wpf samples.

Update:

After more time profiling the application, I think I’ve found the issue. My app loads in about 1-2gb of data into memory, deserializing into a collection. Normally not a problem but when resizing the chart the app hangs for several seconds. It seems the charts create a WritableBitmap which in turn calls MS.Internal.MemoryPressure.ProcessAdd().
Here it forces a garbage collection, and given I have several gigabytes it takes too long.
This connect bug outlines the issue with a possible workaround https://connect.microsoft.com/VisualStudio/feedback/details/687605/gc-is-forced-when-working-with-small-writeablebitmap

Trouble is I don’t have the chart source to implement this.
I’ve attache a screenshot of the call tree in my profiling, highlighting the MemoryPressure.ProcessAdd() call. Here it take 7 seconds to complete.

  • jakupj asked 5 years ago
  • last active 5 years ago
1 vote
6k views

Hi,

I am trying to swap one of our graphs to use the new DX10 surface but are unable to do so.

As per the release notes for the DX10 render functionality we added DX and the SciChart Wpf3d dll’s as references in the project, added the s3D namespace to the XAML and set the render surface to ‘Direct3D10RenderSurface’ but upon starting the application the graph disappear.

In XAML editor we get the warning message on the reference to ‘s3D:Direct3D10RenderSurface’:

‘Could not load type ‘Abt.Controls.SciChart.Wpf.XmlFileSite’ from assembly ‘Abt.Controls.SciChart.Wpf, Version=3.1.0.4549 …..’

We have switched to use the SciChart NuGet feed for the SciChart references.

Is there any more things we need to do in order to enable DX10 RenderSurface ?

Best regards
-Magnus

  • haumag asked 5 years ago
  • last active 5 years ago
Showing 2 results
This template supports the sidebar's widgets. Add one or use Full Width layout.