I generate a histogram columnstacked as a stacked bar chart (see data and code below). The auto-generated diagram looks great, but the colors repeat too early (the first four colors appear twice):
I'd like to use random colors, but determined/seeded by project ids so the colors don't change over time. I found how to set colors explicitly, but I would like to keep this as generic as possible. How to do that?
Data:
id,title,alice,bob,charly,diana,eleanor
foo1,Foo1 Project,,,,,
foo2,Foo2 Project,,22,,,
foo3,Foo3 Project,18,4,,10,
bar1,Bar One,,,4,4,15,
bar2,Bar Two,,,,2,
bar3,Bar Three,,,,,
baz1,First Baz,4,6,10,7,
baz3,Second Baz,,3,,,
baz3,Third Baz,2,,6,2,2,
quux1,Quux the 1st,4,6,6,1,
quux2,Quux the 2nd,,,8,,10,
quux3,Quux the 3rd,,,2,4,
Gnuplot code:
csvfile = 'wochenvorschau/alle.csv'
set datafile separator ','
set output 'output/persons.png'
set terminal png size 1000,600
set term png font "sans"
set style data histograms
set style histogram columnstacked
set style fill solid 0.7 noborder
set boxwidth 0.75
set xtics rotate by 90 right
set grid ytics linestyle 0
set key outside
set xlabel "Person"
set ylabel "Arbeitsstunden"
set timestamp "Stand: %d.%m.%Y %H:%M" bottom
stats csvfile using 0 nooutput
colmax = STATS_columns
rowmax = STATS_records
plot for [COL=3:colmax] csvfile using COL title columnhead, \
for [ROW=1:rowmax-1] '' every ::ROW::ROW using (t=strcol(2),NaN) with boxes lc ROW title t
