I am using Charts with Highcharts and it is working quite well, but it seems like the default colors set in /admin/config/content/charts are not applying when I create a new chart. It seems like the colors the module is suggesting are just randomly generated.

Here's some screenshots to show the discrepancy.

Issue fork charts-3300070

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

srdtwc created an issue. See original summary.

andileco’s picture

Hi @srdtwc, can you download the latest 5.0.x-dev and try again? Also, please note that this only works on Views created after this version.

srdtwc’s picture

StatusFileSize
new96.11 KB

I am not seeing a difference in behavior. I've switched to the dev branch, ran updb and I am still seeing default colors that don't match what I have set in the module settings.

If it's helpful, I am not using Views here, bur rather the Chart field type with Highcharts

chart interface

andileco’s picture

@srdtwc, yes, that's helpful. Will investigate.

nikathone made their first commit to this issue’s fork.

srdtwc’s picture

StatusFileSize
new91.13 KB

Tried this merge request as a patch (https://git.drupalcode.org/project/charts/-/merge_requests/39.patch) and it works! Thanks for taking a look at this

One small issue I am still seeing is it seems like the first color for the first column is still not coming from the default colors. If I add more columns, those seem fine. Also if I switch "Categories are identified by" to row instead of column it is also fine.

screenshot of bug

nikathone’s picture

Status: Active » Needs review

The first color is probably set/coming from the chart field default value.

Thank you for the quick review and reporting the issue.

  • andileco committed 60e26ff on 5.0.x authored by nikathone
    Issue #3300070 by nikathone, srdtwc, andileco: Default colors not...
andileco’s picture

Status: Needs review » Fixed

Thank you, @Nia. I made a couple very small changes and committed.

@srdtwc, if you're trying this on an old field, whatever color was in the default settings for the field will take precedence over the default colors set in the Chart Settings page. If you create a new Charts field, it will have the default colors with this patch.

srdtwc’s picture

@nikathone ah yes, you are correct. I changed the color in the field setting and now it's all working as expected.

Status: Fixed » Closed (fixed)

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