title: How to use variable for data in Charts.js Pie Chart?
body: <p>I am trying to generate a pie chart with values from textboxes. I am using Chart.js. This is the code with hard-coded values and it works fine:</p>
  
  <pre><code>&lt;script&gt;
          var sharePiePolorDoughnutData = [
          {
              value: 50,
              color: "#455C73",
              highlight: "#34495E",
              label: "Si Day"
      },
          {
              value: 50,
              color: "#9B59B6",
              highlight: "#B370CF",
              label: "Si Night"
      },
          {
              value: 150,
              color: "#BDC3C7",
              highlight: "#CFD4D8",
              label: "Mi Day"
      }
  
  ];
  
      $(document).ready(function () {
          window.myPie = new Chart(document.getElementById("canvas_doughnut").getContext("2d")).Pie(sharePiePolorDoughnutData, {
              responsive: true,
              tooltipFillColor: "rgba(51, 51, 51, 0.55)"
          });
      });
  </code></pre>
  
  <p></p>
  
  <p>I have tried this but it still does not work:</p>
  
  <pre><code>&lt;script&gt;
      var charttotalsedaypic = document.getElementById("tbtotalsedaypic").value;
      var sharePiePolorDoughnutData = [
          {
              value: [charttotalsedaypic],
              color: "#455C73",
              highlight: "#34495E",
              label: "Si Day"
      },
          {
              value: 50,
              color: "#9B59B6",
              highlight: "#B370CF",
              label: "Si Night"
      },
          {
              value: 150,
              color: "#BDC3C7",
              highlight: "#CFD4D8",
              label: "Mi Day"
      }
  ];
  
      $(document).ready(function () {
          window.myPie = new Chart(document.getElementById("canvas_doughnut").getContext("2d")).Pie(sharePiePolorDoughnutData, {
              responsive: true,
              tooltipFillColor: "rgba(51, 51, 51, 0.55)"
          });
      });
  </code></pre>
  
  <p></p>
  
  <p>Any suggestions?</p>