Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to set a condition to format the text color on a bar chart (plot values inside segment) based on the background color. For example the darker the background color is the lighter the text color should be, and vice versa. I have many plot values, and the bar char colors are dynamic, so assigning a fix value to each color is not possible.
Ideally, this is what it should look like:
Unreadable, want to avoid this scenario where text inside the dark color is unreadable:
Any ideas on how to set a condition that would dynamically adjust the text color based on a random background color?
Thanks!
Only if you know in advance what the background color is or can calculate the background color. As I said with random background colors you don't.
You can use expressions for both the background color of the bar segments and for the text color of the segments. That way you have full control over them. If you use random colors then you don't know what background color you get so you can't determine what text color you should use. It's probably easiest to create a color table in the script with colors for each dimension value and use those in the chart.
Is it possible to set an expression that would set the text color based on how dark the background is?
Only if you know in advance what the background color is or can calculate the background color. As I said with random background colors you don't.
Thank you Gysbert!