Horizontal floating bar chart with Typescript and chart.js v3.1.1 #9003
Unanswered
davidbroglie
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to make an horizontal bar chart with chart.js v3.1.1 and Typescript.
I'm facing an issue with the data in dataset and the type of data. I tried to do the provided example in the documentation... But the type of the data I get from that example is not working. And I can't find a type that works...
Here is what I tried :
First try with
I expected to have 4 bars in the chart but I have a type error with the data :
Type '[number, number]' is not assignable to type 'number | ScatterDataPoint | BubbleDataPoint | null'
.So then I tried to reproduce the example in the documentation :
And I do have this error :
Type 'number[][]' is not assignable to type '(number | ScatterDataPoint | BubbleDataPoint | null)[]'.
I can't find a type that works properly... Does anybody can help me with that problem ?
Beta Was this translation helpful? Give feedback.
All reactions