
<div class="chart">
  <canvas id="<%= chart_id %>" width="<%= canvas_width %>" height="<%= canvas_height %>"></canvas>
</div>
<script>
new Chart(document.getElementById('<%= chart_id %>').getContext('2d'), {
  type: 'scatter',
  data: {
    datasets: <%= JSON.generate(data_sets) %>
  },
  options: {
    title: {
      display: true,
      text:    "Throughput Chart"
    },
    responsive: <%= canvas_responsive? %>, // If responsive is true then it fills the screen
    scales: {
      x: {
        type: "time",
        time: {
            format: 'YYYY-MM-DD'
        },
        scaleLabel: {
          display: true,
          labelString: 'Date Completed'
        },
        grid: {
          color: <%= CssVariable['--grid-line-color'].to_json %>
        },
      },
      y: {
        scaleLabel: {
          display: true,
        },
        title: {
          display: true,
          text: 'Count of items'
        },
        min: 0,
        grid: {
          color: <%= CssVariable['--grid-line-color'].to_json %>
        },
      },
    },
    plugins: {
      tooltip: {
        callbacks: {
          label: function(context) {
            return context.dataset.data[context.dataIndex].title
          }
        }
      },
      annotation: {
        annotations: {
          <%= working_days_annotation %>
        }
      }
    }
  }
});
</script>

