2

The vue-chartjs Line chart wants a type of

ChartData<"line",(number | Point | null)[],unknown>

as data.

In native chartjs you are supposed to adjust the type. (ChartData <'bar', {key: string, value: number} []>) How do I assign my data variable with the datastructure to the Line component without getting an typescript error?

I could give it the custom type and before giving the data variable to the component cast it as any to get no typescript errors? Is there any better solution? How do you do it? Or is that an issue for the github repo?

2
  • I am also getting a type error with Line Chart , but not with Pie Chart. Did you ever solve this? Commented Dec 1, 2023 at 17:11
  • no, I am still using the cast as any before assigning it... Commented Dec 5, 2023 at 8:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.