Is there a way to repeat the x values in a grouped box plot without explicitly specifying?
From the grouped box plot example:
var x = [‘day 1’, ‘day 1’, ‘day 1’, ‘day 1’, ‘day 1’, ‘day 1’,
‘day 2’, ‘day 2’, ‘day 2’, ‘day 2’, ‘day 2’, ‘day 2’]
var trace1 = {
y: [0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3],
x: x,
name: ‘kale’,
marker: {color: ‘#3D9970’},
type: ‘box’
};
I want to repeat Day 1 without explicitly specifying how many times to repeat ‘day 1,’ I want to repeat ‘day 1’ for each y value available. This assums all the values in y are for ‘day 1’
Something like:
var trace1 = {
y: [0.2, 0.2, 0.6, 1.0, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3],
x: y[‘Day1’],
name: ‘kale’,
marker: {color: ‘#3D9970’},
type: ‘box’
};