Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow array for line opts in dataset #10179

Merged
merged 3 commits into from Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions types/index.esm.d.ts
Expand Up @@ -177,8 +177,10 @@ export interface LineControllerDatasetOptions
extends ControllerDatasetOptions,
ScriptableAndArrayOptions<PointPrefixedOptions, ScriptableContext<'line'>>,
ScriptableAndArrayOptions<PointPrefixedHoverOptions, ScriptableContext<'line'>>,
ScriptableOptions<LineOptions, ScriptableContext<'line'>>,
ScriptableOptions<LineHoverOptions, ScriptableContext<'line'>>,
ScriptableOptions<Omit<LineOptions, keyof CommonElementOptions>, ScriptableContext<'line'>>,
ScriptableAndArrayOptions<CommonElementOptions, ScriptableContext<'line'>>,
ScriptableOptions<Omit<LineHoverOptions, keyof CommonHoverOptions>, ScriptableContext<'line'>>,
ScriptableAndArrayOptions<CommonHoverOptions, ScriptableContext<'line'>>,
AnimationOptions<'line'> {
/**
* The ID of the x axis to plot this dataset on.
Expand Down
13 changes: 13 additions & 0 deletions 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'],
}]
},
});