In brief the powerChart has pen and plot bindings which you can utilize. These are accessible lists. When you add a pen or plot in the designer you can see the structure in the props section. Below is a more detailed explanation to get you 80-90% down the road.
1 - The Configuration of pens and plots can be saved as a list of dictionaries. This can be accomplished by saving the values into SQL on a button action and read back this list onStartup of the root container.
2 - Agree
3 - For Tags
This can be accomplished by utilizing the props.pens[].enabled
For Plots
Utilize external calls to modify the props.plots by removing the plot from the list. Make sure to save a default list to reload.
Disabling all the tags with that plot number does hide the plot
4 - Export function already works. Recommend users email after.
5 - Ability to rename plots and show name of plot on chart.
Agree
6 - This can be done with the enable paramater of each tag. Having an external list to have users select from
7 - Auto Range to selected pens
This happens automatically when the pen is disabled. Changing visibility is the built in checkmark on the chart.
8 - Agree, it would be nice to get access to the tagAdd() function from the built in button. However, you can maintain this externally with your own list of tags. From item 1
8.1 There is a pen binding. You need to return a list of pen dictionaries though.
9 AGREE!
10 - No Comment
11 - you can maintain your own list of colors.
This is accessible props.pens[][‘styles’][‘normal’][‘fill’][‘color’]
Below is the structure of a pen. this can be created in script. I configured my script to scan a UDT for historical tags and display them together.
This is one pen you would need to generate 1 of these per tag and put them in a list
[{},{}]
{
“name”: “Display Name”,
“visible”: true,
“enabled”: false,
“selectable”: true,
“axis”: “”,
“plot”: 2,
“display”: {
“type”: “line”,
“interpolation”: “curveLinear”,
“breakLine”: true,
“radius”: 3,
“styles”: {
“normal”: {
“stroke”: {
“color”: “#e6194b”,
“width”: 1,
“opacity”: 0.8,
“dashArray”: 0
},
“fill”: {
“color”: “#e6194b”,
“opacity”: 0.8
}
},
“highlighted”: {
“stroke”: {
“color”: “#63BEA2”,
“width”: 1,
“opacity”: 1,
“dashArray”: 0
},
“fill”: {
“color”: “#63BEA2”,
“opacity”: 1
}
},
“selected”: {
“stroke”: {
“color”: “#63BEA2”,
“width”: 1,
“opacity”: 1,
“dashArray”: 0
},
“fill”: {
“color”: “#63BEA2”,
“opacity”: 1
}
},
“muted”: {
“stroke”: {
“color”: “#63BEA2”,
“width”: 1,
“opacity”: 0.4,
“dashArray”: 0
},
“fill”: {
“color”: “#63BEA2”,
“opacity”: 0.4
}
}
}
},
“data”: {
“source”: “”: “”
}
}
Structure for a plot as an item of a list as well.
{
“relativeWeight”: 1,
“color”: “#FFFFFF”,
“markers”: [],
“style”: {
“classes”: “”
}
}