Separating Pens on the Selection of Dropdown Labels

I would like to create drop down list, that will have 6 or more labels but not constant. Each label corresponds to a group of tags. I would then link the labels to the Easy chart. I can enter the labels manually.
However, I would like to know if it is possible to write some script to populate the drop down menu.
I want to know if i am selecting one label from drop down list then based on the label there are certain tags associated with labels which need to be shown in easy chart. same for the other labels
Awaiting your response…

Yes. You can use the runScript() expression function in a binding to call a script function that returns the dataset you want. You can use the system.dataset.toDataSet() script function to construct that dataset from a python list of lists (the inner lists being the rows).

The pens to be displayed on an EasyChart can be selected by supplying datasets to its pens and tagPens properties. You could keep a table in your database that contains the lists of pens that correspond to the keys in your dropdown dataset. Then the EasyChart properties could have query bindings that include your dropdown’s selected key.

Sir, Could you elaborate more on the scripting section. I have tried to build a script as name FillChart

def filldropdown(GroupNo):
import system
header = [“values”,“path”]
data = []
temp = [1,2,3,4,5,6,7]
tag = []
if GroupNo == ‘1’:
tag = temp
for i in range(7):
tag[i] = temp[i] + (GroupNo-1) * 7
for j in range(7):
data.append([“Tag %i”%(tag[j]), “Path/Tag%i”%(tag[j])])
return system.dataset.toDataSet(header,data)
I have linked the run script to tag Pens Binding property as : runScript(“app.chart.fillChart(” + {Root Container.Dropdown.selectedValue} + “)”, 0)

How could i do that…