Type '{ type: string; name: string; data: any; }[]' not assignable to type
See original GitHub issueIm 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:
- Created 5 years ago
- Comments:6
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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?