Skip to content

[BUG] polarArea angleLines don't align with data borders #5907

@custompro12

Description

@custompro12

Expected Behavior

Enabling the angleLines for a polarArea type chart should draw angleLines that align with the borders of a data segment.

Current Behavior

Data segment borders appear to be rendering at the correct (default) startAngle, but angleLines of the chart are about -1 degree off.

Possible Solution

Not a solution but my current workaround is this:
Since you can't change the startAngle of the angleLines, instead I change the options.startAngle of the polar area chart data to -0.509 * Math.PI (which makes it crooked, but aligned with the angleLines) and then also set a CSS transform (of transform: rotate(1.5deg)) onto the canvas element itself to rotate the chart back to vertical. (See commented out parts of the jsfiddle)
Charts exported with toBase64Image() are still crooked, since the CSS doesn't apply to them.

Steps to Reproduce (for bugs)

https://jsfiddle.net/8tn903pj/

Context

I need to be able to identify empty data segments on the polar area chart, so I need to show the angleLines.

Environment

  • Chart.js version: ^2.7.3
  • Browser name and version:Chrome 70/71 and Firefox 63/64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions