SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components


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.

Same version with AndroidExample Source
  • You must to post comments

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,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.