title: Put the 0 at the same position on two arrays in javascript
body: <p>Sorry for my english, really really tired...</p>
  
  <p>Imagine two arrays:</p>
  
  <pre><code>var a = [-10, 5, 0, 5, 10, 15];
  var b = [-20, 0, 20, 40, 60, 80];
  </code></pre>
  
  <p>Every value of each array increments by the same number (<code>a</code> by 5 and <code>b</code> by 20).
  I would like to find a way to put the zero on the same position on both arrays.</p>
  
  <p>Keep in mind that:</p>
  
  <ul>
  <li>each serie has the same number of elements</li>
  <li>you can change the min and max value of each array (the original min and max of a serie have to be a part of the serie, check the example below)</li>
  <li>each value of the array increments by the same number, you can change this value</li>
  </ul>
  
  <p>The expected result could be something like</p>
  
  <pre><code>var a = [-10, 5, **0**, 5, 10, 15];
  var b = [-60, -30, **0**, 30, 60, 90];
  </code></pre>
  
  <p><code>b</code> increments now by 30 and the original min (-20) and max (8) values are included in the interval.</p>
  
  <p>Any idea on how to do that using javascript?</p>
  
  <p>Why I'd like to do that? To solve something like that:
  <a href="http://peltiertech.com/Excel/Charts/AlignXon2Ys.html" rel="nofollow">http://peltiertech.com/Excel/Charts/AlignXon2Ys.html</a></p>
  
  <p>Thanks in advance</p>
  
  <p>Rob</p>