title: Passing data from controller to view to build plot
body: <p>Im kinda new to web apps and the world of javascript, jquery, json, knockout, etc, etc
  Im trying to do something real simple but not getting to work. I want to pass data from controller to view to build a plot using morris.js.</p>
  
  <p>I google it  and tried several attempts, none succeeded.</p>
  
  <p>The view recieves something like this to buils the graph:</p>
  
  <pre><code>&lt;script&gt;
      new Morris.Line({
      // ID of the element in which to draw the chart.
      element: 'myfirstchart',
      // Chart data records -- each entry in this array corresponds to a point on
      // the chart.
      data: [
      { year: '2008', value: 20 },
      { year: '2009', value: 10 },
      { year: '2010', value: 5 },
      { year: '2011', value: 5 },
      { year: '2012', value: 20 }
      ],
      // The name of the data record attribute that contains x-values.
      xkey: 'year',
      // A list of names of data record attributes that contain y-values.
      ykeys: ['value'],
      // Labels for the ykeys -- will be displayed when you hover over the
      // chart.
      labels: ['Value']
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Now i want to send the data from the controller using the viewbag or something else.
  For what i understood JSON is the most correct way, just dont know how to use it.</p>
  
  <p>Can you show me how please?</p>