Skip to content

CategoryBar values is not filling in the bar #771

Closed Answered by SamX23
SamX23 asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry, so silly of me

I should have realized that it was a percentage, so what I did was use this code to convert the values

const totalUser = 38 + 17;
const firstValue = Math.round((38  / totalUser) * 100);
const secondValue = Math.round((17 / totalUser) * 100);
const values = [firstValue, secondValue];

I hope this helps others, cheers

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@russ0133
Comment options

@SamX23
Comment options

Answer selected by SamX23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants