-
I'm trying to make a multi-series chart like the example here: https://www.chartjs.org/docs/latest/samples/other-charts/multi-series-pie.html problem is on this line :
Property 'flat' does not exist on type '(string | ((ctx: ScriptableContext<"doughnut">, options: AnyObject) => Color) | _DeepPartialObject | ... 5 more ... | ((ctx: ScriptableContext<...>, options: AnyObject) => Color))[]'. Do you need to change your target library? Try changing the It seems like the backgroundColor is typed as a Color which is a String so the flat() function does not apply. how can I fix this ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The
The array.flat() was introduced in es2019. |
Beta Was this translation helpful? Give feedback.
The
datasetColors
is an array created in the lines above, so it hasflat()
.The compler error suggests the right fix:
The array.flat() was introduced in es2019.