JSFiddle - React, Tailwind, and code Playground

by instant1100

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js"></script>
<div class="test">
    <canvas id="myChart">
    </canvas>
</div>

CSS

.test {
        width: 250px;
        height: 225px;
    }

JavaScript

var ctx = document.getElementById("myChart").getContext('2d');
var myChart = new Chart(ctx, {
    type: 'bar',
    data: {"labels":["Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"datasets":[{"label":"Billable Assigned","backgroundColor":"rgba(178,39,70, .9)","hoverBackgroundColor":"rgba(178,39,70, .9)","borderWidth":0,"data":[2.5,3,3,3,3,3,3]}]},
    options: {
        "maintainAspectRatio": false,
        "scales": {
            "xAxes": [{
                "stacked": true,
                "categoryPercentage":1 ,
                "barPercentage":1,
                "ticks":{"fontSize":10},
                "gridLines": {
                   // "tickMarkLength":20,
                }
            }],
            "yAxes":[{
                "stacked":true,
                "ticks":{
                    "fontSize":10,
                    "beginAtZero":true
                }
            }]},
        "legend":{
            "position":"bottom",
            "labels":{
                "boxWidth":18,
                "boxHeight":10,
                "fontSize":10
            }
        },
        "tooltips":{
            "mode":"label",
            "bodyFontSize":10,
            "callbacks":{}
        }
    }
});