Page 1 of 1

Chart conditional formatting based on value from other column of dataset

Posted: Mon Jul 22, 2024 12:06 pm
by pvb
I have a dataset like this:

Code: Select all

Col1, Col2
0.5,   1.3
1,     2.0
0.6,   2
3,     1
I want to do bar chart for Col1 with condition that bars are red when Col2 > Col1, and green otherwise. In the case above only last pair do not fulfill the condition, so first 3 columns will be red and the last one will be green. So I want to have result simillar to this (different case than data above):
Chart1.png
Chart1.png (12.22 KiB) Viewed 12285 times
My question is how can I construct conditional formatting of one column using comparition with other column? In Report Designer I suceeded only using constant value. Is it possible to use datasource field value for comparition?

Re: Chart conditional formatting based on value from other column of dataset

Posted: Mon Jul 22, 2024 7:39 pm
by Lech Kulikowski
Hello,

Unfortunately, it is not possible.

Thank you.

Re: Chart conditional formatting based on value from other column of dataset

Posted: Sun Jul 28, 2024 11:21 am
by pvb
Hello, thank you for the answer.

So I ask again - is there any other way to control the color of individual bar in one of data series? For example I can do the comparition while retrieving data and then pass resulted color in my dataset together with data, as hex or any other way. Like the JSON code bellow. First value is height of the bar, second is the color of the bar.

Code: Select all

{
  "data": [
    {
      "value": 10,
      "color": "green"
    },
    {
      "value": 20,
      "color": "green"
    },
    {
      "value": 12,
      "color": "red"
    }
  ]
}

Re: Chart conditional formatting based on value from other column of dataset

Posted: Mon Jul 29, 2024 12:16 pm
by Lech Kulikowski
Hello,

Unfortunately, at the current moment, it is not possible.

We have added this task in our to-do list.

Thank you.
#14967

Re: Chart conditional formatting based on value from other column of dataset

Posted: Mon Jul 29, 2024 8:47 pm
by pvb
Thank you.

Re: Chart conditional formatting based on value from other column of dataset

Posted: Tue Jul 30, 2024 7:16 am
by Lech Kulikowski
Hello,

You are welcome.