question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Type '{ type: string; name: string; data: any; }[]' not assignable to type

See original GitHub issue

Im getting this error and the descriptions on how to fix it make no sense. I tried as Highcharts.SeriesColumnOptions and as Highcharts.SeriesLineDataOptions

and this is my code: new Chart({ title: { text: 'Pareto' }, xAxis: { categories: ['a', 'b', 'c'], crosshair: true }, yAxis: [{ title: { text: 'r' } }], series: [{ //line 272 type: 'column', name: 'p1', data: [1,2,3] }, { type: 'line', name: 'p2', data: [3,2,1] }] })


ERROR in mycomp.component.ts(272,9): error TS2322: Type '{ type: string; name: string; data: any; }[]' is not assignable to type '(SeriesAbandsOptions | SeriesAdOptions | SeriesAoOptions | SeriesApoOptions | SeriesAreaOptions | SeriesArearangeOptions | SeriesAreasplineOptions | SeriesAreasplinerangeOptions | ... 82 more ... | SeriesZigzagOptions)[]'.
  Type '{ type: string; name: string; data: any; }' is not assignable to type 'SeriesAbandsOptions | SeriesAdOptions | SeriesAoOptions | SeriesApoOptions | SeriesAreaOptions | SeriesArearangeOptions | SeriesAreasplineOptions | SeriesAreasplinerangeOptions | ... 82 more ... | SeriesZigzagOptions'.
    Type '{ type: string; name: string; data: any; }' is not assignable to type 'SeriesZigzagOptions'.
      Types of property 'type' are incompatible.
        Type 'string' is not assignable to type '"zigzag"'.
mycomp.component.ts(288,9): error TS2322: Type '{ type: string; name: string; data: any; }[]' is not assignable to type '(SeriesAbandsOptions | SeriesAdOptions | SeriesAoOptions | SeriesApoOptions | SeriesAreaOptions | SeriesArearangeOptions | SeriesAreasplineOptions | SeriesAreasplinerangeOptions | ... 82 more ... | SeriesZigzagOptions)[]'.
mycomp.component.ts(39,9): error TS2322: Type 'string' is not assignable to type '"area" | "map" | "line" | "polygon" | "areaspline" | "bar" | "column" | "pie" | "scatter" | "spline" | "abands" | "ad" | "ao" | "apo" | "arearange" | "areasplinerange" | "aroon" | ... 73 more ... | "zigzag"'.
mysecondcomp.component.ts(60,9): error TS2322: Type 'string' is not assignable to type '"area" | "map" | "line" | "polygon" | "areaspline" | "bar" | "column" | "pie" | "scatter" | "spline" | "abands" | "ad" | "ao" | "apo" | "arearange" | "areasplinerange" | "aroon" | ... 73 more ... | "zigzag"'.


im using angular 7.1.3

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

24reactions
Rolodocommented, Mar 20, 2019

series: [ { name: “Countries”, color: “#E0E0E0”, enableMouseTracking: false, type: undefined, },

fixed my problem

6reactions
nitinprajapati1404commented, May 2, 2019

series: [ { name: “Countries”, color: “#E0E0E0”, enableMouseTracking: false, type: undefined, },

fixed my problem

it works for me

but before there is no need to declare type in seris so now why we need to do it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is "not assignable to parameter of type never" error in ...
I get the following TS error: [ts] Argument of type 'string' is not assignable to parameter of type 'never'. What am I doing...
Read more >
What is not assignable to parameter of type never error in ...
I get the following TS error: [ts] Argument of type 'string' is not assignable to parameter of type 'never'. What exactly am I...
Read more >
Type incompatible for relation id fields: Type 'string' is not ...
Typescript compiler complains about the relation id string field of on 'Many' side of One-To-Many relation as of type incompatibility. New to ...
Read more >
Type 'string' is not assignable to type 'never'.ts(2322)
I have attached code in VS code which helps to generate dummy data. the basic purpose of having pagination in anguar 6 project....
Read more >
type 'string' is not assignable to type 'number'.ts(2322) - You.com
While the expression data[name] in your code is of type string | number , any value assigned to this expression must be assignable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found