Skip to content

Commit 970150f

Browse files
committed
Update chart.js
1 parent 08cfb62 commit 970150f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

  • packages/widgets/resources/js/components

packages/widgets/resources/js/components/chart.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ export default function chart({ cachedData, options, type }) {
128128
options.plugins.legend.labels ??= {}
129129
options.plugins.legend.labels.generateLabels ??= (chart) => {
130130
const labels =
131-
Chart.overrides[type].plugins.legend.labels.generateLabels(
132-
chart,
133-
)
131+
Chart.overrides[
132+
type
133+
].plugins.legend.labels.generateLabels(chart)
134134

135135
for (const label of labels) {
136136
label.strokeStyle = darken(label.fillStyle, 0.2)
@@ -173,17 +173,17 @@ export default function chart({ cachedData, options, type }) {
173173
normalizeDatasets(data) {
174174
for (const dataset of data?.datasets ?? []) {
175175
if (type === 'bar' && dataset.backgroundColor !== undefined) {
176-
dataset.borderColor ??= darken(
177-
dataset.backgroundColor,
178-
0.2,
179-
)
176+
dataset.borderColor ??= darken(dataset.backgroundColor, 0.2)
180177
dataset.hoverBorderColor ??= darken(
181178
dataset.backgroundColor,
182179
0.3,
183180
)
184181
}
185182

186-
if (type === 'scatter' && dataset.backgroundColor !== undefined) {
183+
if (
184+
type === 'scatter' &&
185+
dataset.backgroundColor !== undefined
186+
) {
187187
dataset.borderColor ??= dataset.backgroundColor
188188
}
189189

0 commit comments

Comments
 (0)