fix default font color for legend (#8139)

* fix default font color for legend
* adjusted docs to be consistent with fontColor to color
This commit is contained in:
LeeLenaleee 2020-12-05 20:34:34 +01:00 committed by GitHub
parent 9b7eb5095a
commit ae04fcf3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ var chart = new Chart(ctx, {
legend: {
display: true,
labels: {
fontColor: 'rgb(255, 99, 132)'
color: 'rgb(255, 99, 132)'
}
}
}

View File

@ -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;