Perspective - XY Charts column colors - Conditional

Hello,

I am working in Perspective to setup some XYcharts on my dashboard.

I am trying to setup an XY column chart with column styles for each x value depending on their respective y values.

For example on the chart below, my reference would be the red line value. If under I would be columns would be red, if over, columns would be green.

I am already able to change the whole series colors based on that, but still not able to do that per column.

Any idea in which properties of my XYchart I would be able to find this value?
Any idea if such setup is possible, and if not, should I just split this in two series (1 red, 1 green)

Thanks,

Alexandre

You will want to use the deriveFieldsFromData property.

You'll need to add a property to set the color with for each data point. You will want to set this property based on the value.


Then you will need to add the name of the property to the deriveFieldsFromData. You could use multiple properties if you wanted different fill and stroke colors.

1 Like

Hi guys,

I have set up my XY chart, as a bar chart and have the bars showing red for out of spec and green for in spec. This is working lovely in preview mode.

cuscom

My problem is when I launch the perspective session the colours in the chart aren't being passed to the launched session.

cuscom1

Would anyone have any idea why this is?

Thanks
Richard

So it appears the problem was when the session was launched the query was polling, thus losing the values in the color column.

I fixed this by creating a nested query which added the values for the color to the column as the query was polling.