title: Generating two dimensional array between min and max number using D3.js
body: <p>I am new to D3.js so please bear with me. The below image shows what I am trying to draw and it was created in Excel. It has this beautiful curve for each object. </p>
  
  <p><a href="https://i.stack.imgur.com/XON0R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XON0R.png" alt="enter image description here"></a></p>
  
  <p>I get this smooth line based on this formula. I will get parameters for Alpha ,Beta and max for X and based on that I have to find y using the formula below ->   y=Alpha(1-2.71828*(-Beta*x)) and x has to be a number generated from min 100 to spent amount by incrementing by 100. </p>
  
  <p>In Excel I can just generate the number for X like this and find y for each </p>
  
  <pre><code>100     1.28E-01
  200     0.256638873
  300     0.384674585
  400     0.51252152
  500     0.640179956
  600     0.76765017
  700     0.894932441
  800     1.022027046
  900     1.14893426
  1,000   1.275654361
  1,100   1.402187624
  1,200   1.528534325
  </code></pre>
  
  <p>but in JS base on the below, how to generate X which should increment by 100 between 0 to the spent amount and it should create two dimensional array in order to provide for X, Y for each object. For example, if min is 0 and max is 20000, how to generate array between min and max which increments at 100?</p>
  
  <p>How to calculate Y based on generated X? Can you please give me some guidance in order to create this two dimensional array to draw this line using D3.js?</p>
  
  <pre><code>name    alpha        beta       max_x_val   spend
  BAN1    140.3       3.86E-05    28,675.00   29,919.00
  BAN2    115.31      2.08E-05    32,302.00   28,367.00
  BAN3    5.07E-05    19,740.00   16,972.00
  ADJ4    91.8        0.000029119 25,855.00   27,112.00
  ADJ5    90.3        2.81E-05    25,793.00   23,883.00
  </code></pre>
  
  <p>I can draw the line using below code which works great, only if I can create two dimensional array for each object. </p>
  
  <pre><code>$( document ).ready(function() {
     var bezierLine = d3.svg.line()
      .x(function(d) { return d[0]; })
      .y(function(d) { return d[1]; })
      .interpolate("basis");
  
  var svg = d3.select("#bezier-demo")
      .append("svg")
      .attr("width", 300)
      .attr("height", 150);
  
  svg.append('path')
      .attr("d", bezierLine([ [0.1, 0.13], [0.2, 0.26], [0.3, 0.38], [0.4, 0.51], [0.5, 0.64], [0.6, 0.77]]))
      .attr("stroke", "red")
      .attr("stroke-width", 1)
      .attr("fill", "none")
      .transition()
          .duration(2000)
          .attrTween("stroke-dasharray", function() {
              var len = this.getTotalLength();
              return function(t) { return (d3.interpolateString("0," + len, len + ",0"))(t) };
          });
  });
  </code></pre>