Kozea / Kozea/pygal

Pygal Legend colors do not map customized color set

Open
#504 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
419
PR merge metrics
No merged PRs in 30d

Description

Hi,

We are using Pygal 2.2.1 with Python 2.7

I successfully tried the following sample (custom style based on 5 colors) :
http://www.pygal.org/en/stable/documentation/custom_styles.html

When adding a sixth data entry, the color on the graph is a new sixth color derived from the first one: fine !
To do that, I simply add a new data line:
chart.add('F', [9, 4, 2, 1, 2, 10, 5])

However, the color of the legend is not that one; it seems the colors on the legend uses a repeating series of the 5 originals ones ...

Do I miss something ? Or is this a well known bug ?

Regards,

Bernard

Contributor guide

Open the contributing guide

Research direction

Start with the custom styles example in the Pygal documentation and reproduce the issue using Pygal 2.2.1 with a five-color style and the added sixth data line. Trace how graph colors and legend colors are selected; done means the sixth legend entry uses the same derived color as the sixth graph entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.