Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow dynamic datasets to be colored (#10964)
* Allow dynamic datasets to be colored * revieuw
- Loading branch information
1 parent
532c140
commit 41f8128
Showing
6 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
labels: [0, 1, 2, 3, 4, 5], | ||
datasets: [ | ||
{ | ||
data: [5, 5, 5, 5, 5, 5] | ||
} | ||
] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
display: false, | ||
} | ||
}, | ||
y: { | ||
ticks: { | ||
display: false, | ||
} | ||
} | ||
}, | ||
plugins: { | ||
legend: false, | ||
colors: { | ||
enabled: true | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
run(chart) { | ||
chart.data.datasets.push({ | ||
data: [5, 5, 5, 5, 5, 5] | ||
}); | ||
|
||
chart.update(); | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions
43
test/fixtures/plugin.colors/dynamic-datasets-force-override.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module.exports = { | ||
config: { | ||
type: 'bar', | ||
data: { | ||
labels: [0, 1, 2, 3, 4, 5], | ||
datasets: [ | ||
{ | ||
data: [5, 5, 5, 5, 5, 5] | ||
} | ||
] | ||
}, | ||
options: { | ||
scales: { | ||
x: { | ||
ticks: { | ||
display: false | ||
} | ||
}, | ||
y: { | ||
ticks: { | ||
display: false | ||
} | ||
} | ||
}, | ||
plugins: { | ||
legend: false, | ||
colors: { | ||
enabled: true, | ||
forceOverride: true | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
run(chart) { | ||
chart.data.datasets.push({ | ||
data: [5, 5, 5, 5, 5, 5] | ||
}); | ||
|
||
chart.update(); | ||
} | ||
} | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.