Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

Change color depending on result 26.08.2017 08:19

I have results of a calculation showing in a table. What I would like is:
If result is 6 or greater then color is green.
If result is

Edited by dhoeke - 26.08.2017 08:20

Re: Change color depending on result 26.08.2017 09:20

Hi,
please note the forum has some character restrictions due to security reasons, that's why you see the content is incomplete. We assume you want to change dynamically the color of one output section, you can achieve this applying a dynamic style at the output, for ex:

td style="color:##resultcolor##"

and then you can 'calculate' the $resultcolor at the code section, using an 'if' structure:

if($calculatedresult>=6){
$resultcolor="#308B30";
}
else{
$resultcolor="#801515";
}

Hope this helps, you can place a ticket at the helpdesk in case you need further help, there we can share code without restrictions.

Regards
Moonsoft Team
www.moonsoft.es

Re: Change color depending on result 31.08.2017 13:30

Many thanks. In the end I had to work with this:

td style=color:$resultcolor

+ the calculation

But that worked.

Edited by dhoeke - 31.08.2017 13:32

Edited by dhoeke - 31.08.2017 13:32

Re: Change color depending on result 01.09.2017 10:19

Hi,
ok, great it worked, thanks for sharing!

Regards
Moonsoft Team
www.moonsoft.es
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Our clients' feedback