SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & 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

Hi,

Let me explain the structure of attached views. Default view state is https://imgur.com/a/zqAqpXp .

<VerticalViewPager>
    <FirstPagedFragment>
         <TradingViewFragment>
             <WebView />
         </TradingViewFragment>
         <SciChartFragment>
             <com.scichart.charting.visuals.SciChartSurface />
         </SciChartFragment>
    </FirstPagedFragment>
    <SecondPagedFragment> 
           ... 
    </ SecondPagedFragment>
</VerticalViewPager>

When FirstPagedFragment is dragged, SecondPagedFragment becomes displayed. You can see it on https://imgur.com/a/2VqZ1HY

The problem is the chart becomes disappeared when ViewPager is on changing state. Here is another link : https://imgur.com/a/xDO6Xtx

It is happened on [Samsung Galaxy S9, API 26] and [Xiaomi Mi A1, API 25] and I did not update displayMetric of chart.
Is there any configuration to fix this issue? Thanks.

All images are attached.

Version
2.2.1.2391
Images
  • You must to post comments
0
0

Hi Changhee,

It looks like that this issue is caused by our default RenderSurface implementation which is based on GLSurfaceView which draws its content outside View hierarchy. It looks like that ViewPager uses some kind of drawing cache to animate transition and it doesn’t record content of GLSurfaceView. As result when transition starts ViewPager doesn’t include content of GLSurfaceView. To workaround this issue you can use alternative RenderSurface implementations such as RenderSurface and GLTextureView:

    UpdateSuspender.using(surface) {
  surface.renderSurface = RenderSurface(activity)

  Collections.addAll<IAxis>(surface.getXAxes(), xAxis)
  Collections.addAll<IAxis>(surface.getYAxes(), yAxis)
  Collections.addAll<FastCandlestickRenderableSeries>(surface.getRenderableSeries(), rSeries)
}

Also you can extend SciChartSurface class and override its default render surface ( please take a look on suggestion #3 from my reply in this question ) so you won’t need to set it for every chart instance.

Hope this will help you!

Best regards,
Yura

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.