Skip to content

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

@CharlesMcKelvey

Description

@CharlesMcKelvey

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions