List data structure
; create instance vars iData (List), iValue (Int 32), iLegend (Char)
Do iData.$add(10,’Alan – %%’)
Do iData.$add(20,’Brian – %%’)
Do iData.$add(50,’Charlie – %%’)
Do iData.$add(60,’Debbie – %%’)
Do iData.$add(40,’Ernie – %%’)
The Bar and Pie chart components are further described in the online docs here.
Graph2 External Component
In this case, the chart is created in memory and the chart ‘image’ binary is assigned to a Picture control on the remote form.
# create instance vars: iData (List) containing the list data, built in the construct
# iGraph (Binary) assigned to $dataname of the picture control
# iGraphObj (Object) Graph2 is the subtype
Do iGraphObj.$dataname.$assign(iData) Returns #F
Calculate lHeight as pHeight
Calculate lWidth as pWidth
Do iGraphObj.$snapshot(lWidth,lHeight) Returns lSnapShot
Do pictformat(lSnapShot) Returns lPicFormat
Do pictconvto(lPicFormat,lSnapShot,’png’) Returns iGraph
Calculate iGraph as bytecon(iGraph,””)
The Graph2 external component allows a high degree of flexibility for charting your data and many 1oos of variations are available. The component is documented online here.
Download a Free Trial of Omnis Studio 10.1
If you would like to try out all the chart & graphing options in Omnis Studio, you can download the latest version and register for a free 90-day trial: