After reading Carl and Colby’s responses to the thread on assigning values to a variable in code, I think I have started to understand better how to use Factory PMI. It seems that most of what I’ve been trying to do in code can easily be done without any. Please comment on the following approach to building a chart:
- Create root container variables for anything that accepts user input (select boxes, check boxes, etc.) or is passed in on opening.
- Bind these variables to the input controls (drop downs, etc.)
- Create datasets as needed, using as parameters (if needed) the root container variables
- Bind the datasets to chart series.
To turn on or off a chart series, execute the following code on an itemStateChanged property of a checkbox:
isChecked = event.stateChange == event.SELECTED root = fpmi.gui.getParentWindow(event).rootContainer chart = root.getComponent("Chart") chart.setDatasetEnabled([i]SERIESNAMEHERE[/i], isChecked)
Is there any advantage to putting datasets on the root as opposed to on the chart? Any gaps in this approach?
TIA D. Lewis