Skip to content

Color_per_datum with more than 10 data points and custom colours supplied by user - black bars drawn from bar 12 onwards #32

@derekbruening

Description

@derekbruening

From jacp1...@gmail.com on October 25, 2013 11:38:46

What steps will reproduce the problem?

  1. Plot a simple graph with more than 10 data points, with color_per_datum set and a list of colours more than 12 entries long. The attached file contains a graph definition that exhibits the problem.

What is the expected output? What do you see instead?
I expect to see the bars colored in the order specified in the list. However from the 12th bar they are coloured black

What version of the product are you using? On what operating system?
Bargraph.pl v 4.7 Centos 5.6

Please provide any additional information below.
This seems to be because @fillstyle is not populated beyond element 11. The relevant code is below, I think the if ($custom_colors) section should also be setting $fillstyle[$i] to 20.

} elsif ($use_colors) {
$colorcount = $num_nongrayscale if ($color_per_datum);
# colors: all solid fill
for ($i=0; $i<$colorcount; $i++) {
$fillstyle[$i]=20;
}
if ($custom_colors) {
$colorcount = $#custom_color+1 if ($color_per_datum);
for ($i=0; $i<$colorcount; $i++) {
$fillcolor[$i]=$colornm{$custom_color[$i]};
}
} else {

Attachment: colourtest.txt

Original issue: http://code.google.com/p/bargraphgen/issues/detail?id=32

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions