test 3618 duplicate PR

by SAiTO TOSHiKi

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.js"></script>
<div class="container">
  <div class="chart-container">
    <canvas id="myChart2"></canvas>
  </div>
  <div class="chart-container">
    <canvas id="myChart3"></canvas>
  </div>
</div>

<script>
  window.chartColors = {
    red: 'rgb(255, 99, 132)',
    orange: 'rgb(255, 159, 64)',
    yellow: 'rgb(255, 205, 86)',
    green: 'rgb(75, 192, 192)',
    blue: 'rgb(54, 162, 235)',
    purple: 'rgb(153, 102, 255)',
    grey: 'rgb(231,233,237)'
  };

</script>
//chart.js 2.4.0 build with
<script></script>

CSS

.chart-container {
  width: 500px;
  margin-left: 40px;
  margin-right: 40px;
  margin-bottom: 40px;
}

.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

JavaScript

// report for chart.js v2.4.0
Chart.plugins.register({
  beforeDatasetsDraw: function(chartInstance) {
    var ctx = chartInstance.chart.ctx;
    var chartArea = chartInstance.chartArea;
    ctx.save();
    ctx.beginPath();
    ctx.rect(chartArea.left, chartArea.top, chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
    ctx.clip();
  },
  afterDatasetsDraw: function(chartInstance) {
    chartInstance.chart.ctx.restore();
  },
});

//--------- 
// sample chart
//---------
var data = {
  labels: ["January", "February", "March", "April", "May", "June", "July"],
  datasets: [{
    label: "My Second dataset",
    backgroundColor: window.chartColors.red,
    borderColor: window.chartColors.red,
    data: [10, 20, 30, 40, 50, 60, 70]
  }, {
    label: "My First dataset",
    backgroundColor: window.chartColors.orange,
    borderColor: window.chartColors.orange,
    data: [15, 25, 35, 45, 55, 65, 75]
  }]
};

//--------- 
var ctx2 = document.getElementById("myChart2");
var config2 = {
  type: "bar",
  data: data,
  options: {
    title: {
      display: true,
      text: "Bar with min option."
    },
    scales: {
      xAxes: [{
        ticks: {
          min: "March",
        },
        //categoryPercentage: 1,
        //barPercentage: 1,
      }]
    }
  }
};
var myLineChart2 = new Chart(ctx2, config2);

//--------- 
var ctx3 = document.getElementById("myChart3");
var config3 = {
  type: "horizontalBar",
  data: data,
  options: {
    title: {
      display: true,
      text: "horizontalBar with min option."
    },
    scales: {
      yAxes: [{
        ticks: {
          min: "March",
        }
        //categoryPercentage: 1,
        //barPercentage: 1,
      }]
    }
  }
};
var myLineChart3 = new Chart(ctx3, config3);