Chart line colours

#1

(Sorry, I've read a couple of suggestions, but I am still not getting it.)

I have a chart and I am feeding 2 data sets into it.

I get that they have to have different topics so the chart shows them correctly.

But where I am sticking is where/how to set the colours?

If it is one series, sure there is the colour selection thing in the chart box.

But 2 series? There isn't a second/third/etc colour selector.

I've tried setting msg.color to a value, but that doesn't seem to be working.

Thanks in advance.

0 Likes

#2

Solved!

For the sake of anyone who is also stuck and want to know how to set colours on a chart with multiple lines.

When you open the CHART icon and scroll down to the colour selection section.

The colour/s for the sets of data are:
From top left to the right, then down to the next row, left to right.

So, if you have ONE set of data, it will use the top right colour.
If you have TWO sets of data, set #1 will use the top right colour, the set #2 will use the next colour which is to the right of that first colour.

I have only two sets. If you have three sets of data, the third set will use the top right colour.

I have seen a lot of people stuck on this problem.

I hope this helps others.

See attached picture to show the colour selection order.

The red numbers are the number for which set of data.

0 Likes

#3

You also also set the colors using a
msg.ui_control = {"colors":['#FF0000', '#00FF00', '#0000FF', '#000000', '#000000', '#000000', '#000000', '#000000', '#000000']};
right before the final
return msg;
in any object in front of the chart node.
Example would turn first 3 attached sources into red, green, blue .....
And as long as you ensure the order of the msgs being served all remains pretty static.
Though it doesn't work straight out of the box since it does require an update on the displayed webpage after such a change. Means if the flow gets started by an injection most times nothing happens until the next inject does take place of if you simply press the update button on the displaying browserpage.

0 Likes

#4

Isn't that 'top left colour' etc?

2 Likes

#5

I stand corrected.

Sorry: left/right. I easily get them confused.

Luckily now while driving though.

0 Likes