Take controller default options into account to fix mixed charts#5997
Take controller default options into account to fix mixed charts#5997benmccann wants to merge 1 commit intochartjs:masterfrom
Conversation
|
I just realized a potential issue with the implementation proposed in this PR. What it proposes to do is merge options in the order of:
Unfortunately, I just realized this might break in the case that the user has manually specified an option that matches the default value. In that case we might want to keep the user supplied value, but there's no way to differentiate what's user-supplied vs default. The user may call |
|
Another option which may work better would be to resolve option in a different order:
This would be far easier to implement and wouldn't have any edge cases. In terms of usage: |
|
I'm not too familiar with this part yet, but I think that user provided options should be kept separately and applied after merging defaults. Also I'm not so sure if merging should be done at all, since if makes difficult to detect and properly apply changes after initialization. So I wonder if all options could be |
I agree. Unfortunately that's not possible until v3. |
This fixes mixed line and scatter charts. Issue described in #4587
Closes #5151