- Issue created by @khoebeke
- πΊπΈUnited States andileco
Hi @Khoebeke - there are a few ways to do this currently but it depends a little on how you have your data set up and the library you are using (Highcharts is the best for this just because we've worked on this submodule the most). Can you share more details of your instance and approach?
- π§πͺBelgium khoebeke Brakel
Hi
I use Highcharts.As fields I use 2 fields:
- COUNT title field (used as data)
- Content field (used as my labels)
This way I get only options for 2 colors in my Charts fields, but I have more than 6 different labels, so the chart uses the default colors. I also want to make more charts on my website so just changing the default colors doesn't do it for me. I want to change the default colors per chart.
- First commit to issue fork.
- @nikathone opened merge request.
- Status changed to Needs review
over 1 year ago 9:47pm 4 April 2023 - π¨π¦Canada nikathone Ontario
This initial code is to allow single axis chart type to take advantage of color selection method when grouped. I added a custom property on the
chart_data
element and updated the highcharts library to take advantage of this new property to set the color.It would be good to test this first using highcharts then I can go ahead and customize other libraries. If you want to test this using composer patch here is the path link: https://git.drupalcode.org/project/charts/-/merge_requests/53/diffs.patch
- πΊπΈUnited States andileco
I manually tested this successfully (see attachments), and the automated tests complete successfully too. The code is relatively minimal. I think this is a good solution. This will need to be applied to the other charting libraries, but for now, I'm happy to commit.
-
andileco β
committed c4644d51 on 5.0.x authored by
nikathone β
Issue #3337179 by nikathone, Khoebeke, andileco: Default pie chart...
-
andileco β
committed c4644d51 on 5.0.x authored by
nikathone β
- Status changed to Fixed
over 1 year ago 12:44am 19 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.