Pre loader

Tag: audiosteam

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
9k views

Hello,

I have this app : https://i.ibb.co/sPXMbf1/screenshot-framed-1.png

I would like the graph below (the XyDataSeries) to be drawn from right to left (currently it is drawn from left to right)

I have this function to draw :

val audioDS = XyDataSeries<Int, Short>().apply { fifoCapacity = audioStreamBufferSize }
fun generateAudioStream(buffer: ShortValues) {
           val longs = IntegerValues(buffer.size())
           longs.setSize(buffer.size())
           for (i in 0 until buffer.size()) {
               longs[i] = time++
           }
           audioDS.append(longs, buffer)
        }

And my graph is initialized like this :

 @Override
public void initGraph(Context context) {
    Log.d(TAG, "initGraphs");
    SciChartSurface audioStreamSciChart = new SciChartSurface(context);
    mAudiostream.addView(audioStreamSciChart);
    xAxis = new NumericAxis(context);
    xAxis.setVisibleRange(new DoubleRange(startAudioStreamRange, endAudioStreamRange));
    xAxis.setDrawLabels(false);
    xAxis.setDrawMinorTicks(false);
    xAxis.setDrawMajorBands(false);
    xAxis.setDrawMinorGridLines(false);
    audioStreamSciChart.getXAxes().add(xAxis);

    NumericAxis yAxis = new NumericAxis(context);
    yAxis.setVisibleRange(new DoubleRange(new DoubleRange((double) Short.MIN_VALUE, (double) Short.MAX_VALUE)));
    yAxis.setDrawLabels(true);
    yAxis.setDrawMinorTicks(false);
    yAxis.setDrawMajorBands(false);
    yAxis.setDrawMinorGridLines(false);
    yAxis.setAxisAlignment(AxisAlignment.Left);

    audioStreamSciChart.getYAxes().add(yAxis);

    float lineThickness = SciChartExtensionsKt.dip(context, 1.0F);

    FastLineRenderableSeries f = new FastLineRenderableSeries();
    f.setDataSeries(scichartTools.getAudioDS());
    f.setStrokeStyle(new SolidPenStyle(ColorUtil.Grey, true, lineThickness, null));
    audioStreamSciChart.getRenderableSeries().add(f);
    scichartLayout = mAudiostream.getChildAt(0);
}

I understand that, currently it’s drawn from left to right because i append data on my audioDS, is it possible to make it draw from right to left instead ?

Best regards,
Wavely

Showing 1 result

Try SciChart Today

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

Start TrialCase Studies