title: Chart.js: Minimum value for x-axis at horizontal stacked bar chart
body: <p>I am using Chart.js to generate a horizontal stacked bar chart. The chart currently looks like this:
  <a href="https://i.stack.imgur.com/7P1wr.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7P1wr.jpg" alt="enter image description here"></a></p>
  
  <p>This chart shows the user after how many years they should restorate a specific component of a house. I am trying to change this to in which year the user should do the restoration. Adding the current year to the values results to the following:
  <a href="https://i.stack.imgur.com/GhNAl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GhNAl.jpg" alt="enter image description here"></a></p>
  
  <p>This is pretty much what I need if I could set the starting value of the x-axis to the current year. I tried to do this setting the minimum value like this:</p>
  
  <pre><code>options: {
      scales: {
          xAxes: [{
              ticks: {
                  min: 2017
              },
          ...
  </code></pre>
  
  <p>Unfortunatly results in not displaying the datasets at all like this:</p>
  
  <p><a href="https://i.stack.imgur.com/651iv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/651iv.jpg" alt="enter image description here"></a></p>
  
  <p>I tried all combinations with adding the current year and setting the minimum values but nothing results in a useful chart.</p>
  
  <p>In the following you can see my current source code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var mainChart_ctx = document.getElementById("main_chart").getContext("2d");
  
  var mainChart_config = {
    type: 'horizontalBar',
    data: {
      labels: ['Kellerdecke', 'Fenster', 'Außenwand', 'Erdberührter Boden', 'Dach'],
      datasets: [{
          label: 'Beginn ab heute',
          backgroundColor: 'transparent',
          data: [4, 21, 25, 25, 25],
          borderColor: '#666',
          borderWidth: 1
        },
        {
          label: 'Sanierungsdauer',
          backgroundColor: '#ffcc00',
          data: [2, 5, 5, 5, 5],
          borderColor: '#666',
          borderWidth: 1
        },
        {
          label: 'Mittlere Restlebensdauer',
          backgroundColor: 'orange',
          data: [39, 0, 38, 51, 37],
          borderColor: '#666',
          borderWidth: 1
        },
        {
          label: 'Maximale Restlebensdauer',
          backgroundColor: 'orangered',
          data: [20, 0, 0, 0, 0],
          borderColor: '#666',
          borderWidth: 1
        }
      ]
    },
    options: {
      tooltips: {
        enabled: true
      },
      legend: {
        display: false
      },
      title: {
        display: true,
        text: 'Sanierungsfahrplan',
        fontSize: 24
      },
      scales: {
        xAxes: [{
          ticks: {
            min: 0 /* Todo: change to current year? */
          },
          stacked: true,
          scaleLabel: {
            display: true,
            labelString: 'Jahre',
            fontSize: 16
          }
        }],
        yAxes: [{
          ticks: {
            stepSize: 10
          },
          stacked: false,
          scaleLabel: {
            display: true,
            labelString: 'Bauteil',
            fontSize: 16
          },
        }]
      }
    }
  };
  
  mainChart = new Chart(mainChart_ctx, mainChart_config)</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.bundle.min.js"&gt;&lt;/script&gt;
  
  &lt;canvas id="main_chart"&gt;&lt;/canvas&gt;</code></pre>
  </div>
  </div>
  </p>