Pre loader

Chart in ViewPager disappears on page changing.

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



Let me explain the structure of attached views. Default view state is .

             <WebView />
             <com.scichart.charting.visuals.SciChartSurface />
    </ SecondPagedFragment>

When FirstPagedFragment is dragged, SecondPagedFragment becomes displayed. You can see it on

The problem is the chart becomes disappeared when ViewPager is on changing state. Here is another link :

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.

  • You must to post comments

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,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.