score:2

here's how to achieve this, for anyone curious. this results in conditional scaling of axes when the largest current bar is too small (or large) to be valuable.

var currentmax = 0,
    ratio,
    chartmax = groupdata.top(1)[0].value; // initialize with largest value

row
  .on('postredraw', function(chart){
    currentmax = groupdata.top(1)[0].value; // after redraw, capture largest val
    ratio = currentmax/chartmax;
    if(ratio < .1 || ratio > 1){ // check if bars are too small or too large
        row.elasticx(true);
        chartmax = currentmax; // always be sure to reset the chartmax
        dc.redrawall();
    } else {
        row.elasticx(false);
        chartmax = currentmax;
    }
  });

Related Query

More Query from same tag