I want to color bar charts based on certain value, for example any bar having value more than 5 should display red and less than should display Green. Can we accomplish that in Chart from Table macro ?
Hi @Harsh Shridhar ,
Unfortunately we don't have such option. You may check how to set colors for the Chart from Table macro in our documentation: select the required chart type in the page tree and navigate to the corresponding section.
The conditional formatting is available for tables and supported by the Table Transformer and Table Spreadsheet macros.
Hi @Harsh Shridhar ,
This is me once more time - I've consulted with our developers and understood that I've missed an obvious workaround for your case: please create a sequence "source table <- Table Transformer <- Chart from Table" inside the Table Toolbox macro.
Now go to the Table Transformer macro and set the conditional formatting for your future graph here:
SELECT *,
CASE WHEN 'Weight' < 20
THEN "#99b3ff"
WHEN 'Weight' >= 20 AND 'Weight' < 40
THEN "#ff99e6"
ELSE "#ff9999"
END
AS 'Color'
FROM T1
As you can see, we create a new column with HEX color codes based on the conditional formatting in the query:
Navigate to the Chart from Table macro and use this new column to color your bar chart ("Look -> Select colors -> Colors in table columns"):
Seems that it's exactly your case, hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this solution works perfectly for my scenario, except in my final table, this "Color" column is appearing. Is there any way to hide it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gaurav Sharma ,
You may try the following:
So, as a result when the page is published, you'll see only your chart and the original table - seems this fulfills your request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your comment. I had tried this approach, but the problem is, if chart has to show the data labels, then even though one table is not visible but yet it doubles the count of data in the chart. I hope you get my point.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gaurav Sharma ,
Unfortunately, we didn't get the issue about the data doubling: the reusage of tables with the help of the Table Excerpt/Table Excerpt Include macros is a standard approach. You insert as many Table Excerpt Include macros as you need and create independent table views (charts, pivots, transformed tables, etc.) based on the same source table.
So, let's switch to our support portal that is confidential. Please attach the link to this thread (so that the assigned engineer gets your initial use case) and a screenshot of your macro set up (the page in the edit mode with the source table, the result preview of the chart).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.