Skip to content

fix(types): add angle option to ArcOptions - #12313

Open
TheMankel wants to merge 1 commit into
chartjs:masterfrom
TheMankel:fix/arc-angle-option
Open

TheMankel wants to merge 1 commit into
chartjs:masterfrom
TheMankel:fix/arc-angle-option

Conversation

@TheMankel

Copy link
Copy Markdown

Summary

The angle option is supported at runtime for arc elements, but is missing from the ArcOptions TypeScript definition.

The option is already documented in the Arc Configuration.

Example

The following Polar Area configuration works at runtime, but TypeScript reports an error on angle because the property is missing from ArcOptions:

const angles = [60, 120, 180];
const config = {
  type: "polarArea",
  data: { labels: ["A", "B", "C"], datasets: [{ data: [1, 1, 1] }] },
  options: {
    elements: {
      arc: {
        angle: (context) => angles[context.dataIndex],
      },
    },
  },
};

This change adds the missing angle property to ArcOptions so the existing runtime functionality can be used without a TypeScript error.

Note

If there is a reason why angle is intentionally not part of ArcOptions, please let me know.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant