I have a content type which has an entity reference field referencing a taxonomy vocabulary. I am trying to make a chart using Views which displays a count of how many nodes reference each taxonomy term.

I have it working as a bar or column chart. Each bar is a different color. The colors are configured under "Entity grouping settings" next to each taxonomy term entity label.

If I switch it to the desired pie chart, the pie pieces are the correct size, but they are all the same color. They are all the color under "Field Name" rather than the colors configured for each taxonomy term under "Entity grouping settings" (donut also behaves this way).

I am using Billboard.js.

Am I doing something wrong or is this a bug?

Issue fork charts-3442641

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Liam Morland created an issue. See original summary.

liam morland’s picture

Version: 5.0.12 » 5.0.x-dev
Category: Support request » Bug report
Status: Active » Needs review

I was able to get the colors working by adding a patch to charts_billboard. The patch deals with #grouping_colors, which is currently not used by charts_billboard. I note that charts_highcharts does have code that uses #grouping_colors.

liam morland’s picture

StatusFileSize
new751 bytes

Current merge request contents as a patch.

liam morland’s picture

StatusFileSize
new757 bytes

This patch handles non-existent #grouping_colors. Merge request updated.

andileco’s picture

Thank you for your patch! If you wanted to, you could add that identical code in the C3.js class.

Billboard.js and C3.js are a little neglected within the Charts module just because I end up using Highcharts for my work. I appreciate you identifying, posting, and patching!

liam morland’s picture

OK, I added identical code to charts_c3 in the merge request. I have not tested it since I don't use it.

andileco’s picture

Status: Needs review » Fixed

I tested and confirmed it works - thanks again!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.