From: Jacco van den Berg <39033624+LeeLenaleee@users.noreply.github.com> Date: Mon, 21 Feb 2022 02:31:42 +0000 (+0100) Subject: Allow array for line opts in dataset (#10179) X-Git-Tag: v3.8.0~34 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=16e6acc6b94fd02acd72535e0face94aedfcf5d0;p=thirdparty%2FChart.js.git Allow array for line opts in dataset (#10179) * fix line as array ts error * added test * implement only for the border,background color and radius --- diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index a4f463c25..ace3a249f 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -177,8 +177,10 @@ export interface LineControllerDatasetOptions extends ControllerDatasetOptions, ScriptableAndArrayOptions>, ScriptableAndArrayOptions>, - ScriptableOptions>, - ScriptableOptions>, + ScriptableOptions, ScriptableContext<'line'>>, + ScriptableAndArrayOptions>, + ScriptableOptions, ScriptableContext<'line'>>, + ScriptableAndArrayOptions>, AnimationOptions<'line'> { /** * The ID of the x axis to plot this dataset on. diff --git a/types/tests/controllers/line_styling_array.ts b/types/tests/controllers/line_styling_array.ts new file mode 100644 index 000000000..3b6c6733c --- /dev/null +++ b/types/tests/controllers/line_styling_array.ts @@ -0,0 +1,13 @@ +import { Chart } from '../../index.esm'; + +const chart = new Chart('id', { + type: 'line', + data: { + labels: [], + datasets: [{ + data: [], + backgroundColor: ['red', 'blue'], + hoverBackgroundColor: ['red', 'blue'], + }] + }, +});