Chart.js Chart does not start at

I want to that the Chart start at 0. But it takes always the lower value to start. I already tried a few things but nothing works. It never takes the settings done in de options Part of de javascript part. So i dont know what the issue is. It never starts at 0. But this is what i want to. Please help. Thank you very much 🙂 Looks currently like this:

<!DOCTYPE html>

    <style type="text/css">
    BODY {
        width: 550PX;

    #chart-container {
        width: 100%;
        height: auto;
    <script src=""></script>
    <script src="[email protected]/dist/Chart.min.js"></script>


    <div id="chart-container">
        <canvas id="graphCanvas"></canvas>

    $(document).ready(function() {

    function showGraph() {
                function(data) {
                    var trytime = [];
                    var count = [];

                    for (var i in data) {

                    var chartdata = {
                        labels: trytime,
                        datasets: [{
                            label: 'Erfolgreiche Authentifizerungen',
                            backgroundColor: '#8846f1',
                            borderColor: '#a446f1',
                            hoverBackgroundColor: '#CCCCCC',
                            hoverBorderColor: '#666666',
                            borderWidth: 1,
                            data: count,
                        options: {
                            scales: {
                                yAxes: [{
                                    ticks: {
                                        beginAtZero: true

                    var graphTarget = $("#graphCanvas");

                    var barGraph = new Chart(graphTarget, {
                        type: 'bar',
                        data: chartdata




Your Options object must be outside chartData.

var barGraph = new Chart(graphTarget, {
                    type: 'bar',
                    data: chartdata,
                    options: options

Leave a Reply

Your email address will not be published. Required fields are marked *