title: Make Seekbar follow MPAndroidChart X values
body: <p>I'm working with MPAndroidChart and it's been fine to plot everything. What I need is to have a SeekBar below the chart and be able to highlight different points by moving the SeekBar. </p>
  
  <p>The problem is that the steps of the X values are not regular, not even linear (e.g. <code>[0,19,25,30,33,47,...]</code>). I tried making the SeekBar max value the number of points, but the highlight hardly matches the SeekBar position (see image).</p>
  
  <p><a href="https://i.stack.imgur.com/x0Ndz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x0Ndz.png" alt="Example"></a></p>
  
  <p>Is there a way to align the MPAndroidChart highlight with the SeekBar position?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> Included a naive search method for the nearest x-value. Note that this is not the best approach, but it suits me fine.</p>
  
  <pre><code>private int getNearestXValue(int progress) {
      Log.d("PROGRESS", Integer.toString(progress));
      int nearestValue = 0;
  
      int minimumDistance = Integer.MAX_VALUE;
      int position = 0;
      for (Entry entry : mData) {
          if (Math.abs((int) entry.getX() - progress) &lt; minimumDistance){
              minimumDistance = Math.abs((int) entry.getX() - progress);
              nearestValue = position;
              position++;
          }
      }
  
      return nearestValue;
  }
  </code></pre>