This topic contains 1 reply, has 0 voices, and was last updated by Dew 9 years ago.

  • Author
    Posts
  • #5411

    JonnyBoy333

    I’ve got a formula(text) result column on a project search that I put an html snippet into to get a nice looking bar chart to visually show the progress of the project (I actually got the code from one of the demo accounts)(pic is below). The snippet is mostly html styling of a progress bar but the data is getting pulled using an oracle formula (in my case it’s pulling in the {precenttimecomplete} field). This all makes sense to me but now I’m trying to do something where I want the color of the progress bar to change based on the value of the {percenttimecomplete} field. I’ve put together what I think should work but it’s still throwing an error, I think I’m missing something on how the oracle function puts the data into the html. let me know if you have any ideas.

    Original Code (works):

    Code:

    ‘ || ‘
    ' || '
    ' || ROUND(({percenttimecomplete})*100, 1) || '%

    '
    The part I added in the code above is this:

    Code:
    background-color:#' || CASE WHEN {percenttimecomplete} = .75 AND {percenttimecomplete} This is a cached copy. Click here to see the original post.

  • #5412

    Dew

    Couple things: First, I believe the color values need quotes around them. Second, changing the background color in the section would apply it to every line, thus all the colors would be the same (whatever the color of the last line is). Therefore, you would need to reformulate the code to change the color within the progress-bar div, the same way that the width is styled (I’ll leave that to you to figure out).

  • You must be logged in to reply to this topic.