in reply to How to use Perl to assign different fill colors to columns in the same series of an Excel chart?

You need to add three separate series, each configured with a different colour:
my @colors = ('#ED7D31', '#4472C4', '#00B050'); for my $series (1 .. 3) { my $from = 12 * $series - 10; my $to = $series * 12 + 1; $chart->add_series( name => '=C!$B$1', # Not sure about this one. categories => '=C!$A$' . $from . ':$A$' . $to, values => '=C!$B$' . $from . ':$B$' . $to, fill => {color => $colors[ $series - 1 ]}, data_labels => {value => 1}, gap => 40, ); }

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
  • Comment on Re: How to use Perl to assign different fill colors to columns in the same series of an Excel chart?
  • Select or Download Code