8000 Documentation - Added type number[] to radius by waszkiewiczja · Pull Request #11663 · chartjs/Chart.js · GitHub
[go: up one dir, main page]

Skip to content

Documentation - Added type number[] to radius #11663

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waszkiewiczja
Copy link
Contributor

I updated the documentation regarding the type of radius.
As mentiond #11642 here radius can be number but also number[].

@@ -18,7 +18,7 @@ Namespace: `options.elements.point`, global point options: `Chart.defaults.eleme

| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| `radius` | `number` | `3` | Point radius.
| `radius` | `number`\|`number[]` | `3` | Point radius.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the properties are indexable so you can also add this to the other props

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeeLenaleee Can you clarify what this means? I would be saddened if a documentation update held up the 4.5.0 release

@LeeLenaleee LeeLenaleee modified the milestones: Version 4.4.2, 4.5.0 Feb 28, 2024
@DAcodedBEAT
Copy link
Contributor

@LeeLenaleee let's move this to Milestone 5.0 ?

@LeeLenaleee
Copy link
Collaborator

No this is not breaking, so it will be moved to the next non breaking version

@LeeLenaleee LeeLenaleee modified the milestones: 4.4.3, 4.5.0 May 17, 2024
@nakanoh
Copy link
Contributor
nakanoh commented Jun 10, 2025

Based on the test file test/types/controllers/radar_dataset_indexable_options.ts, we might be able to add the following properties to the Point Configuration section:

  • hoverRadius: number|number[]
  • pointBackgroundColor: Color|Color[]
  • pointBorderColor: Color|Color[]
  • pointBorderWidth: number|number[]
  • pointHitRadius: number|number[]
  • pointHoverBackgroundColor: Color|Color[]
  • pointHoverBorderColor: Color|Color[]
  • pointHoverBorderWidth: number|number[]
  • pointHoverRadius: number|number[]
  • pointRadius: number|number[]
  • pointRotation: number|number[]
  • pointStyle: pointStyle|pointStyle[]
  • radius: number|number[]

This would help users who are looking to customize individual points in their charts, as reported in #11642.

Here's an example from the test file showing these properties being used as arrays in a radar chart configuration:

// test/types/controllers/radar_dataset_indexable_options.ts
const chart = new Chart('test', {
  type: 'radar',
  data: {
    labels: ['a', 'b', 'c'],
    datasets: [{
      data: [1, 2, 3],
      hoverRadius: [1, 2, 3],
      pointBackgroundColor: ['red', 'green', 'blue'],
      pointBorderColor: ['red', 'green', 'blue'],
      pointBorderWidth: [1, 2, 3],
      pointHitRadius: [1, 2, 3],
      pointHoverBackgroundColor: ['red', 'green', 'blue'],
      pointHoverBorderColor: ['red', 'green', 'blue'],
      pointHoverBorderWidth: [1, 2, 3],
      pointHoverRadius: [1, 2, 3],
      pointRadius: [1, 2, 3],
      pointRotation: [1, 2, 3],
      pointStyle: ['circle', 'cross', 'crossRot'],
      radius: [1, 2, 3],
    }]
  },
});

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

Successfully merging this pull request may close these issues.

4 participants
0