Pre loader

change direction of spectogram's data with FastUniformHeatmapRenderableSeries


Hi, i am developping a spectogram, screenshot :

I get the same result from your showcase, now there is some things i want to change but can’t resolve to know how to :
– How can i change data direction to spread from left to right ? (currently right to left)
– How can i clear FastUniformHeatmapRenderableSeries ? Method clear doesn’t work
– How can we set width of FastUniformHeatmapRenderableSeries’s layout to be fixed to a specific seconds number ? (example : there is 10 seconds of data between left and right)

Thank you,

  • You must to post comments

Hi Damien.

  1. To implement left to right updates of heatmap values you need to change code which copies new values into spectrogramItems array so new values will be copied to the beginning of array instead of the end. In SpectrogramViewModel you need to change onNextFFT() method:

    fun onNextFFT(fftData: DoubleValues) {
      val spectrogramItems = spectrogramValues.itemsArray
      val fftItems = fftData.itemsArray
      val spectrogramSize = spectrogramValues.size()
      val fftSize = fftData.size()
      val offset = spectrogramSize - fftSize
      // Change next 2 lines
      // insert new values at the beginning of spectrogramItems 
      // and shift existing values to the right
      System.arraycopy(spectrogramItems, 0, spectrogramItems, fftSize, offset)
      System.arraycopy(fftItems, 0, spectrogramItems, 0, fftSize)
  2. Well, UniformHeatmapDataSeries doesn’t support clearing because memory for it is allocated once when DataSeries is created and after that you can only update its values. However you can try to update heatmap values with transparent color.

  3. You can adjust heatmap size using StartX/Y ( specify where the start point of heatmap is ) and StepX/Y ( size of each cell ) properties

Hope this will help you!

Best regards,

  • You must to post comments

It’s great ! Thank you 🙂

  • You must to post comments
Showing 2 results
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