Report Bar Chart Formatting Help

Hey folks!

I’m having issues with the axis scaling on the bar chart. It appears that for negative values, the chart scales exactly to the size of the negative. When adding labels to the chart, it results in the most negative value being excluded from the chart. I’d set the axis statically, but the data varies depending on report parameters selected by the user.

I’ve replicated the issue using a static CSV, the most negative number is the set-point for the axis.

Am I doing something wrong here?

Thanks,
Andrew


1 Like

Try adding the following on the scripting portion.

plot = chart.getPlot()
yAxis = plot.getRangeAxis()
yAxis.setLowerMargin(.1)

Thanks, that worked well. Much appreciated!

Could this same script be applied to a standard bar graph in a vision window to achieve the same result?

Yes, they’re both the same underlying JFreeChart objects.