nevermind, found it here but I tweaked it a bit. OnRender event of the chart itself type this:
function afterDataSetFilled(series, dataSet, icsc)
{
if( series.getSeriesIdentifier() == "categorySeries" ){
if( dataSet.getValues().length <= 4 ){
icsc.getChartInstance().getBlock().getBounds().setWidth(450);
icsc.getChartInstance().getBlock().getBounds().setHeight(250);
}
if( dataSet.getValues().length > 4 && dataSet.getValues().length < 8 ){
icsc.getChartInstance().getBlock().getBounds().setWidth(450);
icsc.getChartInstance().getBlock().getBounds().setHeight(400);
}
if( dataSet.getValues().length > 8 ){
icsc.getChartInstance().getBlock().getBounds().setWidth(450);
icsc.getChartInstance().getBlock().getBounds().setHeight(600);
}
}
}
"categorySeries" is the title of the "simple series" type that can be found in "Format Chart" tab when chart is double clicked.