Hi, I’m modifying AudioAnalyzer chart example.
- 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?
- 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.
- YoungTae Sung asked 4 years ago
- You must login to post comments
Hi there,
-
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.
-
You can use FIFO Scrolling Charts for this
Best regards,
Yura
- Yura Khariton answered 4 years ago
- You must login to post comments
Please login first to submit.