cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Graphics Calculated Property Expressions ??

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

jamie_cawley
Advisor
Advisor
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

Actually spotted that in the meantime, but it still comes back with the error on removing it ??

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

Excellent Thanks, exactly what i needed

Answers (0)