generateLabels(chart) {
const data = chart.data;
if (data.labels.length && data.datasets.length) {
- const {labels: {pointStyle}} = chart.legend.options;
+ const {labels: {pointStyle, color}} = chart.legend.options;
return data.labels.map((label, i) => {
const meta = chart.getDatasetMeta(0);
text: label,
fillStyle: style.backgroundColor,
strokeStyle: style.borderColor,
+ fontColor: color,
lineWidth: style.borderWidth,
pointStyle: pointStyle,
hidden: !chart.getDataVisibility(i),
generateLabels(chart) {
const data = chart.data;
if (data.labels.length && data.datasets.length) {
- const {labels: {pointStyle}} = chart.legend.options;
+ const {labels: {pointStyle, color}} = chart.legend.options;
return data.labels.map((label, i) => {
const meta = chart.getDatasetMeta(0);
text: label,
fillStyle: style.backgroundColor,
strokeStyle: style.borderColor,
+ fontColor: color,
lineWidth: style.borderWidth,
pointStyle: pointStyle,
hidden: !chart.getDataVisibility(i),
var expected = [{
text: 'label1',
fillStyle: 'red',
+ fontColor: '#666',
hidden: false,
index: 0,
strokeStyle: '#000',
}, {
text: 'label2',
fillStyle: 'green',
+ fontColor: '#666',
hidden: false,
index: 1,
strokeStyle: '#000',
}, {
text: 'label3',
fillStyle: 'blue',
+ fontColor: '#666',
hidden: false,
index: 2,
strokeStyle: '#000',
var expected = [{
text: 'label1',
fillStyle: 'red',
+ fontColor: '#666',
hidden: false,
index: 0,
strokeStyle: '#000',
}, {
text: 'label2',
fillStyle: 'green',
+ fontColor: '#666',
hidden: false,
index: 1,
strokeStyle: '#000',
}, {
text: 'label3',
fillStyle: 'blue',
+ fontColor: '#666',
hidden: false,
index: 2,
strokeStyle: '#000',