- Issue created by @zerbash
- First commit to issue fork.
- πΊπΈUnited States andileco
@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?
- πΊπΈUnited States zerbash
I 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:
$target_axes = array_column($chart_definition['data']['datasets'],'yAxisID'); $y_axis_key = in_array($child, $target_axes) ? $child : 'y';
-
andileco β
committed 0adad8c2 on 5.1.x
Issue #3482290 by zerbash, andileco, nikathone: Secondary axis...
-
andileco β
committed 0adad8c2 on 5.1.x
- π¨π¦Canada nikathone Ontario
andileco β credited nikathone β .
- πΊπΈUnited States andileco
Thank you! Automated and manual tests passed for me.
Automatically closed - issue fixed for 2 weeks with no activity.
- π¨π¦Canada noah
I 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.
- πΊπΈUnited States andileco
Thank 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.