title: Add DataSet Bar Chart - Chart.JS
body: <p>I´m tryng to make a bar chart in chart.js (using chart.js 2.2.2)</p>
  
  <p>I´m in trouble trying to put new datasets in a chart</p>
  
  <p>How can i put a new Dataset "Vendas" with data: [10,20,30,40,50,60,70]</p>
  
  <pre><code>var data = {
          labels: ["January", "February", "March", "April", "May", "June", "July"],
          datasets: [
              {
                  label: "Compras",
                  backgroundColor: [
                      'rgba(255, 99, 132, 0.2)',
                      'rgba(54, 162, 235, 0.2)',
                      'rgba(255, 206, 86, 0.2)',
                      'rgba(75, 192, 192, 0.2)',
                      'rgba(153, 102, 255, 0.2)',
                      'rgba(255, 159, 64, 0.2)'
                  ],
                  borderColor: [
                      'rgba(255,99,132,1)',
                      'rgba(54, 162, 235, 1)',
                      'rgba(255, 206, 86, 1)',
                      'rgba(75, 192, 192, 1)',
                      'rgba(153, 102, 255, 1)',
                      'rgba(255, 159, 64, 1)'
                  ],
                  borderWidth: 1,
                  data: [65, 59, 80, 81, 56, 55, 40],
              }
          ]
      };
  var ctx = $("#barOrgaoAno").get(0).getContext("2d");
          var myBarChart = new Chart(ctx,{
              type: "bar",
              data: data,
  });
  </code></pre>
  
  <p>I tried two examples i got in the internet but i can´t get neither to work</p>
  
  <p>Exemple 1</p>
  
  <pre><code>barChartDemo.addData([dData()], "dD " + index);
  </code></pre>
  
  <p>Exemple2</p>
  
  <p><a href="http://jsfiddle.net/pvak6rkx/" rel="noreferrer">JSFLiddle</a></p>
  
  <pre><code>var myNewDataset = {
          label: "My Second dataset",
          fillColor: "rgba(187,205,151,0.5)",
          strokeColor: "rgba(187,205,151,0.8)",
          highlightFill: "rgba(187,205,151,0.75)",
          highlightStroke: "rgba(187,205,151,1)",
          data: [48, 40, 19, 86, 27, 90, 28]
      }
  
      var bars = []
      myNewDataset.data.forEach(function (value, i) {
          bars.push(new myBarChart.BarClass({
              value: value,
              label: myBarChart.datasets[0].bars[i].label,
              x: myBarChart.scale.calculateBarX(myBarChart.datasets.length + 1, myBarChart.datasets.length, i),
              y: myBarChart.scale.endPoint,
              width: myBarChart.scale.calculateBarWidth(myBarChart.datasets.length + 1),
              base: myBarChart.scale.endPoint,
              strokeColor: myNewDataset.strokeColor,
              fillColor: myNewDataset.fillColor
          }))
      })
  
      myBarChart.datasets.push({
          bars: bars
      })
  
      myBarChart.update();
  </code></pre>