Skip to content

Legend Symbol Parameter to override point style #4804

@touletan

Description

@touletan

I would like to include new options to change the symbol used on chart Legend. I also want this to be independant from the pointStyle value (e.g we can keep 'circle' as line point, but use 'line' as legend symbol).

Potential solution:
add legendSymbol value at options/legend/labels and datasets levels.

legend selection priority selection

  1. If usePointStyle = true -> use pointStyle value (circle by default) for legend symbol
  2. if legendSymbol exists at dataset level -> use that value
  3. if legendSymbol exists at /legend/labels level -> use that value
  4. Default value: rectLg
    Available value: same as pointStyle + rectLg, lineLg and rectRoundedLg.
    *Lg symbols are usign boxWidth for Width while others are usign fontSize * Math.SQRT2

proposed implementation:
https://github.com/touletan/Chart.js/

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