Easy Chart Y axis label orientation

Hi,

Is it possible in ignition vision to change Y axis label orientation of easy chart?

I'd like it to be horizontal rather than vertical since they run into each other when I get a lot of subplots:

Thank you!

This can be done with scripting using the configureChart extension function.

Example:

def configureChart(self, chart):
	# Needed to convert the more intuitive degrees into the required radians
	# ...This could probably also be done close enough without the import using angle * (3.14/180)
	from java.lang import Math
	
	# Check to see if subplots are being used (CombinedDomainXYPlot)
	if hasattr(chart.plot, 'subplots'):
		# Iterate through all of the range axes for each subplot and set the label angle to 45 degrees
		for plot in chart.plot.subplots:
			
			for axis in xrange(plot.rangeAxisCount):
				plot.getRangeAxis(axis).setLabelAngle(Math.toRadians(45))
	else: # (AutoAnnotateXYPlot)
		# Iterate through each range axis of the default ploy rotate all labels 45 degrees
		# ...if there are any axis on the right side, the angle will have to be 225 [45 + 180] to orientate right side up
		for axis in xrange(chart.plot.rangeAxisCount):
			chart.plot.getRangeAxis(axis).setLabelAngle(Math.toRadians(45))

Result:
image

Edit: The original code assumed the implementation of subplots based upon the OP's picture. Updated the code, so it will work whether or not subplots are being used.

2 Likes

Works great, thanks :slight_smile:

1 Like