Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usePointStyle doesn't seem to work for mixed charts #8651

Closed
CharlesMcKelvey opened this issue Mar 16, 2021 · 1 comment · Fixed by #8781
Closed

usePointStyle doesn't seem to work for mixed charts #8651

CharlesMcKelvey opened this issue Mar 16, 2021 · 1 comment · Fixed by #8781

Comments

@CharlesMcKelvey
Copy link

Expected Behavior

I want there to be a rect in the legend for the bar dataset of a mixed chart and am using usePointStyle to accomplish this.

Current Behavior

When turning usePointStyle to false, all legend items are squares, which is expected.
When turning usePointStyle to true, the two line datasets use the point style they are assigned but the bar dataset ignores their's and defaults to the circle instead of the assigned 'rect'.

Possible Solution

usePointStyle should also effect bar datasets along with line datasets for when mixed charts are used.

Steps to Reproduce

Here is an example on Code Pen:
https://codepen.io/ChuckMickieC/pen/ZEBZVjW

Environment

  • Chart.js version: ^2.9.4
  • Browser name and version: Firefox Developer Edition 75.0b11 (64-bit)

Any information on this would be helpful and I would prefer not building out a customized legend as I would think this would be built into ChartJS. I do understand that the pointStyle obviously is in reference to point data but then how else do you customize a bar's legend symbol in a mixed chart? In this way, it would almost benefit it to always make bar charts a 'rect' but that seems too sweeping of a change in case other uses are needed from it.

Thank you in advanced!

@LeeLenaleee
Copy link
Collaborator

Fixed in V3: https://codepen.io/leelenaleee/pen/oNYOmJO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants