Closed (fixed)
Project:
Charts
Version:
5.0.x-dev
Component:
Chart.js integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Oct 2024 at 20:14 UTC
Updated:
3 Dec 2024 at 17:24 UTC
Jump to comment: Most recent

Comments
Comment #4
andileco commented@zerbash - apologies, I wasn't seeing your changes when I made my patch. I'm probably fine with either - can you take a look at them and let me know your thoughts?
Comment #5
zerbash commentedI don't think checking for ['#opposite'] is the best way to determine a secondary y-axis. That's a valid setting that a user may want to apply to the default y. I think if yAxisID has been set, it's fair to assume that the target is not y:
Comment #8
andileco commentedThank you! Automated and manual tests passed for me.
Comment #10
andileco commentedComment #11
noah commentedI have some charts where I'm setting colors via
hook_chart_definition_alter(), and the dataset changing from an object to an array here broke that (resulting in a WSOD with “Error: Attempt to assign property "backgroundColor" on array…”). Fixing it is just a matter of changing, e.g.:$definition['data']['datasets'][$delta]->backgroundColor = $color;to:
$definition['data']['datasets'][$delta]['backgroundColor'] = $color;…but I figured that was worth documenting here in case anyone else runs into this.
Comment #12
andileco commentedThank you, @noah! I'm really sorry for that inconvenience. I enjoy working with arrays more than objects, so hopefully overall this is a more enjoyable experience.