JSFiddle - React, Tailwind, and code Playground

Perception of extent of others’ smartphone usage

by pepperdigital

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'bar'
    },
            credits: {
        enabled: false
    },
     exporting: {
        enabled: false
    },
    colors: ['#86BC25', '#43B02A', '#046A38', '#0097A9', '#62B5E5', 
   '#00A3E0', '#0076A8', '#012169', '#2C5234', '#C4D600'],
    title: {
        text: ''
    },
     tooltip: {
        formatter: function () {
            return this.series.name +
                '<br><b>' + this.y + '%</b>';
        }
    },
    xAxis: {
        categories: [
        'Your child/children',
'Your partner',
'Your parents']
    },
    yAxis: {
        min: 0,
        max: 100,
        labels: {
            format: '{value}%'
        },
        title: {
            text: ''
        }
    },
    legend: {
        reversed: true
    },
    plotOptions: {
        series: {
            stacking: 'normal'
        }
    },
    series: [
    {
        name: 'Do not know',
        data: [7, 3, 9]
    },  {
        name: 'No, I do not think they use it too much',
        data: [16,	34,	61]
    }, {
        name: 'No, they use it a lot, but it is not too much',
        data: [18,	23,	16]
    }, {
        name: 'Yes, probably',
        data: [31,24,11]
    }, {
        name: 'Yes, definitely',
        data: [29, 16, 3]
    }]
});