Pre loader

Performance

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

0
0

I have a question about the scichart performance. I need to display a lot of data on the real time chart and above 2400000 values the chart crops and reacts very slowly. It was tested on Samsung s7. Does scichart handle that much data on devices? Is there any minimum phone performance requirements?

Version
8.0
  • You must to post comments
0
0

VadiaData stores the data received from Bluetooth. addDataToChannel is called 200 times per second

public class VadiaData {
    private int vadiaNumber;
    private long vadiaDate;
    private double channel1;
    private double channel2;
    private double channel3;
    private double channel4;
    ...
  • You must to post comments
0
0

Hi there,

SciChart Android has been tested with up to 1,000,000 points on devices that are a lot older than the Samsung S7.

See SciChart Android Performance Comparison

This is a lot of data to handle, but I think that SciChart should be able to handle it.

Would you mind sharing some code how you have set up the chart? Our team can take a look and may be able to suggest improvements in configuration.

Best regards,
Andrew

  • You must to post comments
0
0

I am sending code where create a chart and add new values

private List<XyDataSeries> seriesData = new ArrayList<>();
private List<IRenderableSeries> series = new ArrayList<>();
private SciChartSurface surface;
private ModifierGroup chartModifiers;

private void initChart(Context context, LinearLayout chartLayout) {

        surface = new VadiaChartSurface(context);
        surface.setTheme(R.style.SciChart_SciChartv4DarkStyle);
        surface.setRenderSurface(new RenderSurface(context));

        if (chartLayout != null) {
            chartLayout.addView(surface);
        }
        SciChartBuilder.init(context);

        sciChartBuilder = SciChartBuilder.instance();
}

private void initAxis(String unit) {

        final IAxis xAxis = sciChartBuilder.newNumericAxis().withLabelProvider(new TimeSpanLabelProvider()).withMaxAutoTicks(3).build();
        final IAxis yAxis = sciChartBuilder.newNumericAxis().withVisibleRange(-1, 20).build();

        Collections.addAll(surface.getYAxes(), yAxis);
        Collections.addAll(surface.getXAxes(), xAxis);    
}

private void initSeriesData(int fifoCapacity) {
    seriesData.add(sciChartBuilder.newXyDataSeries(Long.class, Double.class).withFifoCapacity(fifoCapacity).withSeriesName(Channels.CH1.toString())
            .build());

    seriesData.add(sciChartBuilder.newXyDataSeries(Long.class, Double.class).withFifoCapacity(fifoCapacity).withSeriesName(Channels.CH2.toString())
            .build());

    seriesData.add(sciChartBuilder.newXyDataSeries(Long.class, Double.class).withFifoCapacity(fifoCapacity).withSeriesName(Channels.CH3.toString())
            .build());

    seriesData.add(sciChartBuilder.newXyDataSeries(Long.class, Double.class).withFifoCapacity(fifoCapacity).withSeriesName(Channels.CH4.toString())
            .build());
}

private void initSeries() {
    float strokeThickness = (int) (context.getResources().getDimension(R.dimen.pt_stroke_thickness) / context.getResources().getDisplayMetrics().density);
    boolean antiAliasing = true;

    series.add(sciChartBuilder.newLineSeries()
            .withDataSeries(seriesData.get(0))
            .withStrokeStyle(ColorUtil.Red, strokeThickness, antiAliasing)
            .build());

    series.add(sciChartBuilder.newLineSeries()
            .withDataSeries(seriesData.get(1))
            .withStrokeStyle(ColorUtil.Blue, strokeThickness, antiAliasing)
            .build());

    series.add(sciChartBuilder.newLineSeries()
            .withDataSeries(seriesData.get(2))
            .withStrokeStyle(ColorUtil.Green, strokeThickness, antiAliasing)
            .build());

    series.add(sciChartBuilder.newLineSeries()
            .withDataSeries(seriesData.get(3))
            .withStrokeStyle(ColorUtil.White, strokeThickness, antiAliasing)
            .build());


    for (int i = 0; i < series.size(); i++) {
        series.get(i).setResamplingMode(ResamplingMode.MinMaxWithUnevenSpacing);
        surface.getRenderableSeries().add(series.get(i));
    }
}

private void initChartOverview() {
    chartModifiers = sciChartBuilder.newModifierGroup()
            .withPinchZoomModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).build()

            .withZoomPanModifier().withReceiveHandledEvents(true).withXyDirection(Direction2D.XDirection).withZoomExtentsY(false).build()

            .withXAxisDragModifier().withReceiveHandledEvents(true).withDragMode(AxisDragModifierBase.AxisDragMode.Scale).withClipModex(ClipMode.None).build()

            .build();

    Collections.addAll(surface.getChartModifiers(), chartModifiers);
}


public void addDataToChannels(final VadiaData value) {
    if (chartState == ChartState.Active)
        UpdateSuspender.using(surface, new Runnable() {
            @Override
            public void run() {
                    seriesData.get(0).append(value.getVadiaDate(), value.getChannel1());
                    seriesData.get(1).append(value.getVadiaDate(), value.getChannel2());
                    seriesData.get(2).append(value.getVadiaDate(), value.getChannel3());
                    seriesData.get(3).append(value.getVadiaDate(), value.getChannel4());

        surface.zoomExtentsX();
            }
        });
}
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.

Try SciChart Today

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

Start TrialCase Studies