Pre loader

Tag: fragments black screen labels flashing

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

1 vote
7k views

Hello,

I am currently evaluating SciChart Android and have some questions:

1)
I am using fragments and when I load the fragment with the chart or replace the chart with another fragment, the view flashes black for a moment. This effect is considerable noticeable because I am using a white background for the chart.
VIDEO EXAMPLE

2)
My application domain is like kind of a stock chart. The Y-Values are Doubles while the X-Values are timestamps.
There are small gaps in the data so the distance from each point to the next one is not always the same.
The example dataset consists of 152 datapoints, starts at November 18, 17:00 and end at November 25, 16:00 with distances which are either 1 hour or 2 hours apart.
When zooming and dragging the graph, some labels for the date seem to appear and disappear at random which is really distracting.
VIDEO EXAMPLE

3)
When the user keeps zooming in, the labels should get more detailed.
It is kinda pointless when all the labels are showing the same day. How can I set it, that when the first visible point and the last visible point are only 2 days apart, that the format on the label is HH:MM and not the day and month?

Also, how can I set the maximum zoom? I got it working with the CategoryDateAxis but with the DateAxis it is different and I don’t know how to use the visibibleRangeLimit as the documentation for timeseries charts is rather lacking in this regard.

Our company is considering buying the chart for Android & iOS but those first two problems are king of a deal breaker for us.
Thank you.

My simple style code:

    <style name="CustomSciChart" parent="SciChart_BaseStyle">
    <item name="sciChartBackground">@android:color/white</item>
    <item name="majorGridLinesColor">@color/midLightGray</item>
    <item name="minorGridLinesColor">@color/midLightGray</item>

My chart code:

    final SciChartBuilder sciChartBuilder = SciChartBuilder.instance();
    surface.setTheme(R.style.CustomSciChart);
    XyDataSeries<Date, Double> lineData = sciChartBuilder.newXyDataSeries(Date.class, Double.class).build();
    final DateAxis xAxis = sciChartBuilder.newDateAxis()
            .withDrawMinorGridLines(false)
            .withDrawMinorTicks(false)
            .withAutoRangeMode(AutoRange.Once)
            .build();

    final IAxis yAxis = sciChartBuilder.newNumericAxis()
            .withAxisAlignment(AxisAlignment.Left)
            .withDrawMinorGridLines(false)
            .withDrawMinorTicks(false)
            .withGrowBy(0.2d, 0.2d)
            .build();

    final IRenderableSeries lineSeries = sciChartBuilder.newLineSeries()
            .withDataSeries(lineData)
            .withStrokeStyle(ContextCompat.getColor(getActivity(), R.color.colorPrimary), 2f, true)
            .build();


    PinchZoomModifier pinchZoomModifier = new PinchZoomModifier();
    pinchZoomModifier.setScaleFactor(1.5f);
    pinchZoomModifier.setDirection(Direction2D.XDirection);
    surface.getChartModifiers().add(pinchZoomModifier);

    ZoomPanModifier zoomPanModifier = new ZoomPanModifier();
    zoomPanModifier.setClipModeX(ClipMode.ClipAtExtents);
    zoomPanModifier.setDirection(Direction2D.XDirection);
    zoomPanModifier.setZoomExtentsY(false);
    surface.getChartModifiers().add(zoomPanModifier);


    surface.getRenderableSeries().add(lineSeries);
    Collections.addAll(surface.getYAxes(), yAxis);
    Collections.addAll(surface.getXAxes(), xAxis);

Fragment replacement:

         FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.replace(R.id.content, fragment, tag);
        fragmentTransaction.commit();
Showing 1 result

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies