Get rid of Pie chart shadow

Hi
I’d like flat design so the shadow of the pie chart is so annoying there is no option in properties editor.
Is anyone know how to hide shadow?

Thanks

This will sound counter intuitive but set the chart to 3D Pie and then set 3D Depth to 0

2 Likes

Thanks it works but how i can hide these lines?

set the outline stroke to zero to remove the lines in the ‘pie’

to remove, the border, I’ve used this as the porpertyChange script of the chart:

from java.awt import Color
c = Color(128,128,128,0)
event.source.getChart().getPlot().setOutlinePaint(c)

I set the outline stroke to zero but didn’t work.
For the script it only work only if I change something in properties.

Here’s what I have in a property change script on a chart. Note that the script generally won’t run in designer, but you’ll see the effects in a running client.

For what it’s worth, this is on a ring chart (not 3D). Within the property editor for the chart, the outline stroke is 0.0 and the outline color is clear.

if event.propertyName in ["componentRunning", "data"]:
	
	chart = event.source.getChart()
	plot = chart.getPlot()
	
	# Hide the chart decorations
	plot.setSeparatorsVisible(False)
	plot.setShadowPaint(None)
	plot.setOutlineVisible(False)
2 Likes

Have a read:

3 Likes

Hi, I did like this tip, but give an error, can you help me please?

Traceback (most recent call last):
  File "<event:visionWindowOpened>", line 2, in <module>
TypeError: getComponent(): 1st arg can't be coerced to int

	at org.python.core.Py.TypeError(Py.java:236)
	at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:213)
	at org.python.core.PyReflectedFunction.throwBadArgError(PyReflectedFunction.java:316)
	at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:325)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:171)
	at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:208)
	at org.python.core.PyObject.__call__(PyObject.java:477)
	at org.python.core.PyObject.__call__(PyObject.java:481)
	at org.python.core.PyMethod.__call__(PyMethod.java:141)
	at org.python.pycode._pyx25.f$0(<event:visionWindowOpened>:10)
	at org.python.pycode._pyx25.call_function(<event:visionWindowOpened>)
	at org.python.core.PyTableCode.call(PyTableCode.java:173)
	at org.python.core.PyCode.call(PyCode.java:18)
	at org.python.core.Py.runCode(Py.java:1687)
	at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:806)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.runActions(ActionAdapter.java:206)
	at com.inductiveautomation.factorypmi.application.binding.action.ActionAdapter.invoke(ActionAdapter.java:297)
	at com.inductiveautomation.factorypmi.application.binding.action.RelayInvocationHandler.invoke(RelayInvocationHandler.java:57)
	at com.sun.proxy.$Proxy51.visionWindowOpened(Unknown Source)
	at com.inductiveautomation.factorypmi.application.FPMIWindow.fireVisionWindowOpened(FPMIWindow.java:711)
	at com.inductiveautomation.factorypmi.application.VisionDesktop$RuntimeWindowOpener.openWindow(VisionDesktop.java:545)
	at com.inductiveautomation.factorypmi.application.VisionDesktop.openWindow(VisionDesktop.java:188)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.lambda$openWindowImpl$5(NavUtilities.java:393)
	at com.inductiveautomation.factorypmi.application.script.builtin.WindowUtilities.doGUIAction(WindowUtilities.java:808)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindowImpl(NavUtilities.java:336)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.openWindow(NavUtilities.java:326)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.swapTo(NavUtilities.java:115)
	at com.inductiveautomation.factorypmi.application.script.builtin.NavUtilities.swapTo(NavUtilities.java:92)
	at com.inductiveautomation.factorypmi.application.components.tabstrip.PMITabStrip.setSelectedTab(PMITabStrip.java:482)
	at com.inductiveautomation.factorypmi.application.components.tabstrip.TabHolderPanel.mousePressed(TabHolderPanel.java:243)
	at java.desktop/java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
	at java.desktop/java.awt.Component.processMouseEvent(Unknown Source)
	at java.desktop/javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.Component.processEvent(Unknown Source)
	at java.desktop/java.awt.Container.processEvent(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.Component.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$5.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

Ignition v8.1.10 (b2021090812)
Java: Azul Systems, Inc. 11.0.11

You are using in a window event a script intended for an event on a button or other component that is a sibling of the chart. So, event.source.parent isn’t the right hierarchy. You probably want event.source.rootContainer in its place.

Tip: Use the property search wizard in the upper right to help you construct the python to reference other components.

2 Likes