Conditional BoxPlot - how to change or advice certain colours to the boxes

Hi,
in the post 21532 you helped us with a Conditional Grouped BoxPlot in the generic JavaScript View node. Now we have a follow-up question. How can we assign individual colours to the boxes?
I will be happy if you can help.

here the former forum link: BUG: Conditional box plot - #8 by stelfrich

Hi @Smue,

This is possible via two changes to the JavaScript code in the Generic JavaScript View.

First, insert the following line right before line 42:

var colors = ['#FF4136', 'rgb(107,174,214)', '#FF851B', '#FF4100']

and don’t forget to replace the colors in this example with your colors either by their hex code or their rgb code. Subsequently, insert

marker: {color: colors[columnIndex-1]},

as a new line after line 50 (between the boxmean and name lines). This should render the plot with your defined colors.

Best,
Stefan

3 Likes

Hi Stefan,
perfect!! It works.
many many thanks.
Smue

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.