图表Js - 浪费图表空间

时间:2016-07-28 09:57:18

标签: javascript graph charts

有谁知道Chart JS为什么会浪费图形空间?为什么它不占用图表的整个宽度?

图表位于引导容器中>如果这会产生影响吗?

Chart JS Wasting Space

这是我的代码:

<canvas id="mostPopularProductionApps" width="100" height="150"></canvas>

使用Javascript:

barChartCreator(prodChart, prodLabels, prodData, '# Heorku AddOns', 'Number of AddOns Per Applications');  

barChartCreator: function(DOMLocation, labels, data, label, title) {
      var createdChart = new Chart(DOMLocation, {
          type: 'bar',
          data: {
              labels: labels,
              datasets: [{
                  label: label,
                  data: data,
                  backgroundColor: 'rgba(54, 162, 235, 0.2)',
                  borderColor: 'rgba(255, 255, 255, 1)',
                  borderWidth: 1
              }]
          },
          options: {
              scales: {
                  yAxes: [{
                      ticks: {
                          beginAtZero: true
                      }
                  }]
              },
              title: {
                  display: true,
                  text: title
              }
          }
      });
      return createdChart;
    },

0 个答案:

没有答案