Enhancement: include icons on table charts

9 Comments

  • Rob Stack
    Comment actions Permalink

    Hi Christian, here's the results of an experiment I did. I'll write this up as a proper article after I verify this behavior.

    In this example, if the year is 2017, it will return the HTML code and if it's 2018, the graphic is returned (I assume that would work with icons also?)

    The first line in the graphics test column is an interpreted HTML code and the second is an externally hosted graphic. Here in brief is how it was done:

    1. First, create the table as you want it (don't worry about the column with graphics yet.

    2. Now, in the Chart configuration menu, click Chart. In that menu, ensure Display images is checked and set Text interpretation to HTML (you can set height and width for images also).

    3. Now, create a Standard calculated attribute using something similar to the following formula:

    IF ([Ticket created - Year]="2017") THEN "<span>&#8241;</span>"
    ELIF ([Ticket created - Year]="2018") THEN "https://zen-marketing-documentation.s3.amazonaws.com/docs/en/Explore_recipe_example_2.png"
    ENDIF

    4. Finally, add your new standard calculated attribute to the Rows panel of your query. You should get something like my results above.

    This is based on some preliminary experiments and I'll try to write up something a bit more complete in the near future. I hope it helps!

    1
  • Christian Farley
    Comment actions Permalink

    Hey Rob.
    Much thanks for looking into this. Your solution looks promising. I will experiment and report back.
    Cheers!

    0
  • Christian Farley
    Comment actions Permalink

    I tested Calculated attribute having this formula: "<span>&#8241;</span>".

    The Formula editor does not report an error and displays a green check mark. However when I add this Attribute to my table chart, the query hangs and after a few minutes displays the message "Network Error".

    The chart configuration has "HTML interpretation" and "Display image" checked. 

    0
  • Christian Farley
    Comment actions Permalink

    So I was able to create a table chart with a single row attribute as an image, with the formula below (and I even was able to change its size)

    "<span style=\"font-size: 250%\">&#128030;</span>"


    Unfortunately when I bring this attribute to another table with 6 columns, it chokes up and eventually I get the "Nertwork error" message. Is there a limitation on the amount of columns (row attributes) we can add to a table chart?

    0
  • Rob Stack
    Comment actions Permalink

    Hi Christian, I'm not aware of any specific limitation on the number of columns or rows in a table, but you might be able to remove that error using some of the tips in this article - https://support.zendesk.com/hc/en-us/articles/360040891654

    0
  • Christian Farley
    Comment actions Permalink

    Thanks. But the table in question currently returns 8 rows, 7 columns + 2 metrics. It works fine but when I add the Calculated attribute described above, it hangs and I get a "Network error". Recall that the Attribute is just this: "<span style=\"font-size: 250%\">&#128030;</span>"

    Should I open a support ticket to get this investigated?

    0
  • Rob Stack
    Comment actions Permalink

    Yes, I think this is definitely worth a ticket. I'll open one for you.

    0
  • Christian Farley
    Comment actions Permalink

    Thanks Rob. Finally got it to work. Not sure how. But here is the output. Note that withy the span tag we can set the icon size and colour as desired.

    0
  • Rob Stack
    Comment actions Permalink

    Thank you Christian, I have it on my todo list to experiment more with this and come up with an article or recipe. Your table looks great!

    0

Please sign in to leave a comment.

Powered by Zendesk