JSFiddle - React, Tailwind, and code Playground

CSS

.axis path,
.axis line {
    fill: none;
    stroke: black;
    shape-rendering: crispEdges;
}

.axis text {
    font-family: sans-serif;
    font-size: 11px;
}

JavaScript

var data = [
    {
        "category": "Category1",
        "subcategories": [
            {
                "subcategory": "Subcategory1A",
                "comments": [
                    {
                        "comment" : "1Acomment1",
                        "count": 8,
                    },
                    {
                        "comment": "1Acomment2",
                        "count": 7
                    }
                ]
            },
            {
                "subcategory": "Subcategory1B",
                "comments": [
                    {
                        "comment": "1Bcomment1",
                        "count": 11,
                    }
                ]
            },
            {
                "subcategory": "Subcategory1C",
                "comments": [
                    {
                        "comment": "1Ccomment1",
                        "count": 2,
                    }
                ]
            }
        ]
    },
    {
        "category": "Category2",
        "subcategories": [
            {
                "subcategory": "Subcategory2A",
                "comments": [
                    {
                        "comment": "2Acomment1",
                        "count": 6,
                    },
                    {
                        "comment": "2Acomment2",
                        "count": 9,
                    },
                    {
                        "comment": "2Acomment3",
                        "count": 9,
                    },
                    {
                        "comment": "2Acomment4",
                        "count": 9,
                    }
                ]
            },
            {
                "subcategory": "Subcategory2B",
                "comments": [
                    {
                        "comment": "2Bcomment1",
                        "count": 14
                    }
                ]
            }
         ]
    }
];
                
    var...