I have a columnRange chart with 4 categories that I would like to be able to add the navigator scrollbar at the bottom, or if not possible, create the same chart using the Highstocks library.

This is my code: http://jsfiddle.net/gportela/9rjby/

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'columnrange',
            inverted: true
        },

        title: {
            text: 'Machine Status: Producing'
        },
        subtitle: {
            text: 'Between Dates x and y'
        },
        xAxis: {
            categories: ['Producing', 'Idle', 'Below Rate', 'Changeover']
        },
        yAxis: {
            type: 'datetime',
            dateTimeLabelFormats: { // don't display the dummy year
                month: '%e. %b',
                year: '%b'
            },
            title: {
                text: 'Date'
            }
        },
        legend: {
            enabled: false
        },
        tooltip: {
            formatter: function() {
                return '<b>'+ this.series.name +'</b><br/>'+
                    'Hours: ' + Highcharts.dateFormat('%e. %b (%H:%M', this.point.low) +' - '+ Highcharts.dateFormat('%H:%M', this.point.high) + ')';
            }
        },
        series: [{
            name: 'Hours',
            data: [
                {x:0,low:Date.UTC(2014,  2, 12,7),high:Date.UTC(2014,  2, 12,8),color: "lightgreen"},
                {x:0,low:Date.UTC(2014,  2, 12,10),high:Date.UTC(2014,  2, 12,13),color: "lightgreen"},
                {x:0,low:Date.UTC(2014,  2, 12,17),high:Date.UTC(2014,  2, 12,18),color: "lightgreen"},
                {x:0,low:Date.UTC(2014,  2, 12,19),high:Date.UTC(2014,  2, 12,20),color: "lightgreen"},
                {x:0,low:Date.UTC(2014,  2, 12,22),high:Date.UTC(2014,  2, 12,23),color: "lightgreen"},
                {x:1,low:Date.UTC(2014,  2, 12,15),high:Date.UTC(2014,  2, 12,16),color: "orangered"},
                {x:1,low:Date.UTC(2014,  2, 12,8),high:Date.UTC(2014,  2, 12,9),color: "orangered"},
                {x:2,low:Date.UTC(2014,  2, 12,11),high:Date.UTC(2014,  2, 12,12),color: "GreenYellow"},
                {x:3,low:Date.UTC(2014,  2, 12,19),high:Date.UTC(2014,  2, 12,20),color: "DodgerBlue "}
            ]
        }]

    });

});

Anyone has any idea on how to achieve this?

Thanks,

有帮助吗?

解决方案

Unfortunately scrollbar is available only in highstock on xAxis, but not in yAxis (as it is in inverted chart like yours)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top