Highlighting Specific Cells in Table Chart

Home Forums SPJS Charts for SharePoint Highlighting Specific Cells in Table Chart

Viewing 2 reply threads
  • Author
    Posts
    • #7727
      sgjs2015
      Participant

        I’m sure there’s a simple way to do this, but I have had no luck trying to highlight all cells in my table chart when the string “Pending” is contained within the cell.

        Here is what I have tried so far:
        1) ColorFormat – using the addRange option and value of “Pending, Pending, red, yellow”
        ColorFormat setup

        2) jQuery + CSS code in the CEWP after all AJAX calls are done

        
        
        <script type="text/javascript">
        $(document).ajaxStop(function(){
        $(".google-visualization-table-td:contains('Pending')").css("color", "red");
        });
        </script>

        None of the above methods works. What might be the recommended approach?

        Thanks for your help!

      • #7737
        Alexander Bautz
        Keymaster

          Hi,
          ColorFormat expexts a number range so I guess you must use script. I have tested this and it works, but you must change the timeout to ensure your table is ready:

          setTimeout(function(){
          $("td.google-visualization-table-td:contains('Pending')").css("color","red");
          },3000);

          Hope this helps,
          Alexander

        • #7739
          sgjs2015
          Participant

            Thanks, Alexander — using setTimeout works.

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.