MVC & AngularJs website: How to populate javascript data?
<p>I'm working on my first MVC &amp; AngularJs dashboard application, which uses several javascript based charts &amp; graphs, and I'm trying to figure out the best way to pass data into these javascript charts.</p>

<p>Here's the static html for my dashboard page: 
<a href="http://askwebgurus.com/dashboard/dashboard_main.html" rel="nofollow">enter link description here</a></p>

<p>If you view the source, towards the bottom, around line 675, we begin passing the necessary javascript data into the javascript functions, such as the following for a doughnut chart:</p>

<pre><code>&lt;script&gt;
Chart.defaults.global.legend = {
  enabled: false
};

var data = {
  labels: [
    "Symbian",
    "Blackberry",
    "Other",
    "Android",
    "IOS"
  ],
  datasets: [{
    data: [15, 20, 30, 10, 30],
    backgroundColor: [
      "#BDC3C7",
      "#9B59B6",
      "#455C73",
      "#26B99A",
      "#3498DB"
    ],
    hoverBackgroundColor: [
      "#CFD4D8",
      "#B370CF",
      "#34495E",
      "#36CAAB",
      "#49A9EA"
    ]

  }]
};
/*
var canvasDoughnut = new Chart(document.getElementById("canvas1"), {
  type: 'doughnut',
  tooltipFillColor: "rgba(51, 51, 51, 0.55)",
  data: data
});
*/

var data0 = {
  labels: [
    "Others",
    "Limited Engagement"
  ],
  datasets: [{
    data: [75.9, 24.1],
    backgroundColor: [
      "#BDC3C7",
      "#3498DB"
    ],
    hoverBackgroundColor: [
      "#CFD4D8",
      "#49A9EA"
    ]

  }]
};

var canvasDoughnut = new Chart(document.getElementById("canvas0"), {
  type: 'doughnut',
  tooltipFillColor: "rgba(51, 51, 51, 0.55)",
  data: data0
});
</code></pre>

<p></p>

<p>This data however is static.  I need to retrieve the necessary data from the database.  For example, in the code above, on the line that reads "data: [15, 20, 30, 10, 30],", I would need to populate those values.</p>

<p>What's the best/cleanest way to go about populating this data?  Again, if it helps, I'm using .net MVC 5 &amp; AngularJs for this application.</p>

<p>Thanks</p>