Why not that way? Because I'm an idiot and had totally missed that capability within a custom control. Don't know how I'd missed it, and am thrilled to have it pointed out as there are so many other things that makes possible. Thank you! I may redo this example and update this entry to show before and after.
Further to Jeremy's suggestion you could even pass the entire definition of the chart requirements using XML or JSON
Good points on the use of a scope, in this case, to hold data, but for a custom control, I am curious why you don't create parameters for the custom control to hold the data you want. In the property window for the Custom Control, you can go to the Property Definition tab and define custom properties for the control and their type, and variable name editor type, default values, etc etc. Then the data for each control. can be specified on the control itself using the properties at design time, that can compute to whatever data you wish to pass ot the control at run time.
For example, if you created a string type property with a variable name of "pieData" for instance, you can then, when you place the control into your xPage, specify the value of the pieData through the properties of the placed custom control, or in the XML syntax like this: (Below is a custom control with two custom properties documentUNID and displayID)
In the custom control, you can then access that data by referencing the compositeData object .... to get the value of the documentUNID property above, you would simply use
or for displayID you would use
This way you are lessening the amount and duration the data takes up memory, and ultimately, performance.