From: LeeLenaleee <39033624+LeeLenaleee@users.noreply.github.com> Date: Sat, 5 Dec 2020 19:34:34 +0000 (+0100) Subject: fix default font color for legend (#8139) X-Git-Tag: v3.0.0-beta.8~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae04fcf3c3818a2ceb67556a9bde8da29d42b2c3;p=thirdparty%2FChart.js.git fix default font color for legend (#8139) * fix default font color for legend * adjusted docs to be consistent with fontColor to color --- diff --git a/docs/docs/configuration/legend.md b/docs/docs/configuration/legend.md index a2446b2ce..6a4733e05 100644 --- a/docs/docs/configuration/legend.md +++ b/docs/docs/configuration/legend.md @@ -125,7 +125,7 @@ var chart = new Chart(ctx, { legend: { display: true, labels: { - fontColor: 'rgb(255, 99, 132)' + color: 'rgb(255, 99, 132)' } } } diff --git a/src/plugins/plugin.legend.js b/src/plugins/plugin.legend.js index ef33ae0da..529f82a77 100644 --- a/src/plugins/plugin.legend.js +++ b/src/plugins/plugin.legend.js @@ -311,7 +311,7 @@ export class Legend extends Element { const rtlHelper = getRtlAdapter(opts.rtl, me.left, me._minSize.width); const ctx = me.ctx; const labelFont = toFont(labelOpts.font, me.chart.options.font); - const fontColor = labelOpts.color; + const fontColor = labelOpts.color || defaultColor; const fontSize = labelFont.size; let cursor;