how to display data-point like 0-10,10-20..etc on xAxis in hichart

76 views Asked by At

I want to display data-point like 0-10,11-20…on xAxis. Please check following example. So please suggest me any properties or link for this in hichart

Chart Type : Column Chart

Tool: Hichart

enter image description here

1

There are 1 answers

2
Bobby Orndorff On BEST ANSWER

One option is to include the category labels in the data series. For example...

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
            type: 'category'
        },
        series: [{
            data: [{
                name: '0-10',
                y: 5,
            }, {
                name: '11-20',
                y: 6,
            }, {
                name: '21-30',
                y: 2,
            }, {
                name: '31-40',
                y: 3
            }],
        }]
    });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>

<div id="container"></div>