Is there a way to format the vertical count axis on the Bar Graph chart? I have a dataset that will only include whole numbers. I want the vertical part count to also only show whole numbers.
I was able to temporarily set the range static from 0 to 100 which temporarily solved the issue but I would like to learn how to do this incase the axis needs to be dynamic.
If anyone needs it and for some reason is stuck on Ignition 7.9 like me, this code on propertyChange event works:
from org.jfree.chart.axis import NumberAxis
chart = event.source.chart
if chart is not None:
plot = chart.getPlot()
rangeAxis = plot.getRangeAxis()
if isinstance(rangeAxis, NumberAxis):
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits())
That is a dangerous piece of code for a propertyChange event, as you are not testing the event's propertyName. Which will cause this code to be executed many, many times, likely with future disruptions.
5 Likes
