vendredi 21 octobre 2016

javascript - Highcharts - Type Bar - How to set different starting for each bar

I have bar chart, in which I want each bar to start different value. Now they all starts from 0. I have only find how to change the starting point, that would be the same for each. Like all staring from 1.

But I need the First to be draw like 1-2, Second: 1-4 and Third: 7-10. How can I vary it for different cases?

var chart = new Highcharts.Chart({
chart: {
        type: 'bar',
        renderTo: 'container'
 },
 xAxis: {
        categories: ['First', 'Second', 'Third']
 },
 series: [{
        data: [{
            name: 'Point 1',
            y: 2
        }, {
            name: 'Point 2',
            y: 4
        }, {
            name: 'Point 3',
            y: 10
        }]
 }]
 });

Aucun commentaire:

Enregistrer un commentaire