Skip to content

Bar chart with indexAxis: 'y' requires data.labels whereas 'x' doesn't. - #11688

Closed
ItsRkaj wants to merge 2 commits into
chartjs:masterfrom
ItsRkaj:bug/issue-11684
Closed

ItsRkaj wants to merge 2 commits into
chartjs:masterfrom
ItsRkaj:bug/issue-11684

Conversation

@ItsRkaj

@ItsRkaj ItsRkaj commented Feb 28, 2024

Copy link
Copy Markdown

As reported in #11684, indexAxis y requires data.labels whereas indexAxis x does not. According to the same issue y should be treated as x in this case. Where this PR solves that problem.

This is done by checking if data.labels.lenght is 0 and indexAxis set to y then we transform the data.dataset.data to set the required data.labels and data.dataset.data in order to work as expected.

Closes #11684

@LeeLenaleee

Copy link
Copy Markdown
Collaborator

Hi I appreciate the PR with a fix for the problem. I have made a alternative PR to fix the issue since I don't think putting the data in the labels array is the correct fix.

The underlying issue is in my eyes that the data array was always build staticly instead of dynamically.

@LeeLenaleee

Copy link
Copy Markdown
Collaborator

Fixed in #11690

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.

Bar chart with indexAxis: 'y' requires data.labels (whereas 'x' does not)

2 participants