0

My question

Using jqplot I've made a horizontal stacked bar chart. The chart is working fine, the only problem that I'm having is that the label on my y axis is not showing. Any help you could offer would be greatly appreciated!

What I've tried

  • I've tried messing around with the padding and the size of the div that contains my chart to see if my label might have fallen off or something. That doesn't seem to be the case.

  • I've double checked the location of the CanvasAxisLabelRenderer plugin. Unless I am missing something, that should be correct.

  • I was able to get a label on my x-axis, but using the same code on my y-axis has no effect.

My code

$(document).ready(function() {
    var x1 = [[1,1]];
    var x2 = [[1,1]];
    var xbenchmark = [[1,1],[1,1]];
    var xuworganisatie = [[1.5,1],[1.5,1]];

    var plot2 = $.jqplot('thema2chart', [x1, x2, xbenchmark, xuworganisatie], {
        stackSeries: true,
        seriesDefaults: {
            renderer: $.jqplot.BarRenderer,
            rendererOptions: {barDirection: 'horizontal'},
            pointLabels: {show: false, stackedValue: true}
        },
        gridPadding: {top:50, right:15, bottom:50, left:0},
        series: [
        {shadow: false, color:'#ddd9da'},
        {shadow: false, color:'#908e8e'},
        { 
            shadow: false,
            disableStack : false,//otherwise it wil be added to values of previous series
            renderer: $.jqplot.LineRenderer,
            lineWidth: 2,
            color:'#666666',
            showLine:false, 
            pointLabels: {show: false},
            markerOptions: {size: 7, style:"plus" 
            }},
            { 
                 shadow: false,
                     disableStack : true,//otherwise it wil be added to values of previous series
            renderer: $.jqplot.LineRenderer,
            lineWidth: 2,
            color:'#b4d2dd',
            showLine:false, 
            pointLabels: {
                show: false
            },
            markerOptions: {
                size: 7, style:"plus" 
            }}],
        axes: {
            yaxis: {
                renderer: $.jqplot.CategoryAxisRenderer,
                labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
                label:'Missing'
                }
            ,
            xaxis: {
                label:'Showing',
                min: 0,
                max: 2,
                tickOptions:{showGridline:false, formatString: "%#.0f", show:false},
                tickInterval: 1
                },          
        }
    });
});
mischa_
  • 13
  • 4

1 Answers1

0

Try this

axes: {
        yaxis: {
            label:'Hopefuly showing',
            renderer: $.jqplot.CategoryAxisRenderer,
            labelRenderer: $.jqplot.CanvasAxisLabelRenderer

            }
        ,
        xaxis: {
            label:'Showing',
            min: 0,
            max: 2,
            tickOptions:{showGridline:false, formatString: "%#.0f", show:false},
            tickInterval: 1
            },          
    }
Alborz
  • 2,043
  • 2
  • 20
  • 17