title: How to pass data to d3js using ASP.NET MVC
body: <p>I'm trying to use d3js graph. In the example, it gets the data like this : </p>
  
  <pre><code>d3.tsv("data.tsv", function(d) {
    d.frequency = +d.frequency;
    return d;
  }, function(error, data) {
    if (error) throw error;
  
    x.domain(data.map(function(d) { return d.letter; }));
    y.domain([0, d3.max(data, function(d) { return d.frequency; })]);
  </code></pre>
  
  <p>And the data.tsv file is something like this : </p>
  
  <pre><code>letter  frequency
  A   .08167
  B   .01492
  C   .02782
  D   .04253
  E   .12702
  F   .02288
  G   .02015
  </code></pre>
  
  <p>Suppose I have a List of tuples like this : </p>
  
  <pre><code>public class myData {
  public string x {get; set;}
  public int y {get; set;}
  }
  
  myData data1 = new myData("A", 1);
  myData data2 = new myData("B", 3);
  
  List&lt;myData&gt; list1 = new List&lt;myData&gt;()
          {
           data1, data2
          };
  </code></pre>
  
  <p>How can I pass this <code>list1</code> to d3js? Thanks in advance.</p>