From ae04fcf3c3818a2ceb67556a9bde8da29d42b2c3 Mon Sep 17 00:00:00 2001 From: LeeLenaleee <39033624+LeeLenaleee@users.noreply.github.com> Date: Sat, 5 Dec 2020 20:34:34 +0100 Subject: [PATCH] fix default font color for legend (#8139) * fix default font color for legend * adjusted docs to be consistent with fontColor to color --- docs/docs/configuration/legend.md | 2 +- src/plugins/plugin.legend.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.3