Checkbox Property Control
- Create Boolean document property "cb"
- Create a script that triggers when "cb" document property changes:
#myVis is the target visualization script parameter
from Spotfire.Dxp.Application.Visuals import Visualization
myVis = myVis.As[Visualization]()
myVis.XAxis.Scale.ShowGridlines = Document.Properties["cb"]
myVis.YAxis.Scale.ShowGridlines = Document.Properties["cb"] - Create a calculated value with custom expression and script:
Custom expression:
if(${cb},"[X]",[ ])
Script:
Document.Properties["cb"] = not Document.Properties["cb"]
Radio Button Property Control
- Create multiple Boolean document properties. For example: "op1, op2, op3,..,opN"
- Create a script that triggers when each document property changes.
if Document.Properties["op1"]: myVis.LabelVisibility = LabelVisibility.All
if Document.Properties["op2"]: myVis.LabelVisibility = LabelVisibility.Marked
if Document.Properties["op3"]: myVis.LabelVisibility = LabelVisibility.None - Create a calculated value with custom expression and assign the same script for each option (op1,op2,..,opN)
Custom expression:
if(${op1},"[X]",[ ])
Script:
#dp is the document property to set to true
Document.Properties["op1"] = False
Document.Properties["op2"] = False
Document.Properties["op3"] = False
Document.Properties[dp] = True
2 comments:
Jose are you using CSS and HTML to make the controls look better? I have used this in the past, but not with the Action of the Calculated Value control.
https:// www.w3schools.com/ howto/ howto_css_custom_checkbox.asp
This works great for me but mine does not look as nice as yours with the code snippets provided.
Nice work though!
Thanks Akz
I am not using css or html checkboxes, but unicode characters, but it is a good idea to do so.
Checkout the complete reference here: https://community.tibco.com/s/article/IronPython-Checkbox-Property-Control-for-TIBCO-Spotfire
Post a Comment