Pre loader

Problem with displaying time line on XAxis

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

Hi, I’m modifying AudioAnalyzer chart example.

  1. I want to know that how to display time value on XAxis in this example.

In audio stream chart example, xData value store 0 to 2048 value for each onNext.

like this,

final long[] itemsArray = audioData.xData.getItemsArray();
for (int i = 0; i < minBufferSize; i++) {
itemsArray[i] = time++;
}

I want to display time value like “mm:ss” format on XAxis.

What kinds of data should be stored in itemsArray?

How to setup VisibleRange and labelFormat?

  1. In same example. XAxis lable fixed start to 0(does not move to outside of left for each new data)

How to move xAxis label right to left when new data generated?

Thanks for you kindness.

Version
Same version with AndroidExample Source
  • You must to post comments
0
0

Hi there,

  1. In example we use 44100Hz sample rate ( this gives us 44.1k values per second ) and buffer size is 2048. So this means that each data batch contains ~0.046 seconds of data or ~0.000022 seconds per data point. So to get seconds value for each point, you can define xValue = 0 ( start of record) and increment it using 1 / 44100 as step for each yValue from buffer. This should give you seconds value on XAxis. Them you can specify VisibleRange as window min/max values in seconds. Then create custom label provider and convert seconds value to string with desired pattern.

  2. You can use FIFO Scrolling Charts for this

Best regards,
Yura

  • You must to post comments
Showing 1 result
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