Skip to content

Commit 9d97e28

Browse files
committed
Value highlighting fix
1 parent 499fa7b commit 9d97e28

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@01coder/chartjs-plugin-selectdrag",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Chartjs plugin which allows you to select a range of data by dragging over a chart",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/utils.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ export function highlightChartData(chart, selection: Selection = null) {
4141

4242
// Set highlighted
4343
chart.data.datasets = chart.data.datasets.map((dataset) => {
44-
dataset.backgroundColor = (
45-
output == 'value' ? dataset.data : chart.data.labels
46-
).map((value, index) => {
44+
dataset.backgroundColor = chart.data.labels.map((value, index) => {
4745
if(!selection?.selection || !selection?.selection.start?.x || !selection?.selection.end?.x) {
4846
// Show default
4947
return dataset.backgroundColorDefault || colors.selected;

0 commit comments

Comments
 (0)