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.
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?
How to move xAxis label right to left when new data generated?
Thanks for you kindness.
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
Please login first to submit.