I have been using this workaround for rotating a label using the paintable canvas for a while.
from java.awt import Color
from java.lang import Math
from java.awt import RenderingHints
from java.awt import GradientPaint
from java.awt.geom import Rectangle2D
g = event.graphics
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
fm = g.getFontMetrics()
#g.setColor(event.source.background)
#g.fillRect(0,0,event.width,event.height)
stringWidth = fm.stringWidth(event.source.text)
g.setColor(event.source.foreground)
g.rotate(-Math.PI/2)
g.drawString(event.source.text,-stringWidth,fm.getHeight())
now in 8.0.13
getting an error…
Traceback (most recent call last):
File “event:repaint”, line 17, in
java.lang.NullPointerException
java.lang.NullPointerException: java.lang.NullPointerException
caused by NullPointerException
Ignition v8.0.13 (b2020060815)
Java: Azul Systems, Inc. 11.0.6
I do know in my application the custom property ‘text’ is empty at times.
Thanks for the help.