on 10-18-2007 4:48 PM
Hi,
Can anybody tell me how i create the equivelant of below within the expression box of the Calculated Propertys, in the Dynamic Graphics editor. i.e. im trying to output a colour string based on an input value to the svg ??
If (Value == 0) {
"#FF3333"
}
else if (Value == 1) {
"#FFFF00"
}
else if (Value == 2) {
"FF9900"
}
else if (Value == 3) {
"#FF0000"
}
else{
"#C0C0C0"
}
Thanks,
Emmett
I would suggest doing this in the link editor of the animation renderer using the stringif function?
stringif( value == 0, "rgb(0,255,0)", stringif(value == 2, .......
or make a local xml property with the values and corresponding colors and use xpath to access the correct color.
local.color{/Rowsets/Rowset/Row[value = #your value#]/Color}
Regards,
Jamie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jamie,
Tried this in the link editor like you suggested but it is coming up with a "invalid number of parameters in stringif error" code below:
stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 0, "#00FF00"), stringif(,IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 1, "#FFFF00"), stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 2, "#FFA500"), stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 3, "#FF0000")
Am i missing something ?
Emmett
Emmett,
You have an extra comma in your second stringif...just before the IllumSQLQuery:
stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 0, "#00FF00"), stringif(,IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 1, "#FFFF00"), stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 2, "#FFA500"), stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 3, "#FF0000")
Sam
Emmett,
Also there is an extra parenthesis in your 3rd stringif..can you post the lastest version of your expression as well.
stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 0, "#00FF00"), stringif(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 1, "#FFFF00"), stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 2, "#FFA500") <---- should not be here either
Sam
stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 0, "#00FF00"), stringif(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 1, "#FFFF00"), stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 2, "#FFA500", stringif( IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status} == 3, "#FF0000")
Got rid of "," and ")" still error returned ??
Thanks for the help
Emmett,
Your statement should be this:
stringif( number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == "0", "#00FF00", stringif(number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == 1, "#FFFF00", stringif( number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == 2, "#FFA500", stringif( number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == 3, "#FF0000")
Hope this helps.
Sam
Actually....it's supposed to be this...
stringif( number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == 0, "#00FF00", stringif( number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == 1, "#FFFF00", stringif( number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == 2, "#FFA500", stringif( number(IllumSQLQuery_0.Results{/Rowsets/Rowset/Row/status}) == 3, "#FF0000", "#FFFFFF"))))
Sorry I missed the default color case at the end...
Sam
Message was edited by:
Salvatore Castro
User | Count |
---|---|
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.