The attached demo application demonstrates how to create a pie chart inside an XControl.
There are two scripts in the XControl, called PieChart:
- One of them is in Update property, which is responsible for drawing the chart.
- The other one is in Visible property, responsible for showing/hiding the chart and also for the information next to it.
Both properties’ values are edited via Update button and Visible checkbox, which are on Screen1.
NOTE: After the PieChart XControl has been instanced on the desired screen, ColorVar1 to ColorVar10 and NameVar1 to NameVar10 properties must be filled as needed. In this example, only three out of the ten available data fields are being used in this XControl; therefore, only ColorVar1, ColorVar2, ColorVar3, NameVar1, NameVar2 and NameVar3 variables were filled, and only three setpoints were added to Screen1, linked to the XControl’s Variable1, Variable2 and Variable3 properties.