You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
legendCallback should fire when this._chart.generateLegend() is called.
Actual Behavior
Can't get it to fire.
My charts display, and a generic legend is being generated and shown, but my legendCallback is being ignored, it is not firing. My console.log line ('legCallback') shows nothing. But I know the generateLegend method is working because my (generic) legend shows in my div.
Here is my code:
mounted () {
this.renderChart(this.pielabels, {
responsive: true,
maintainAspectRatio: false,
legendCallback: function (chart) {
var text = []
console.log('legCallback')
text.push('<div>')
for (var i = 0; i < chart.data.datasets.length; i++) {
text.push('<li><span style=\'background-color:#333\'>')
text.push(chart.data.datasets[i].label)
text.push('</span></li>')
}
text.push('</div>')
return text.join('')
},
legend: {
display: false
},
titleFontStyle: 'bold'
})
this.$bus.$emit('legendgen', this._chart.generateLegend())
}
The text was updated successfully, but these errors were encountered:
Expected Behavior
legendCallback should fire when this._chart.generateLegend() is called.
Actual Behavior
Can't get it to fire.
My charts display, and a generic legend is being generated and shown, but my legendCallback is being ignored, it is not firing. My console.log line ('legCallback') shows nothing. But I know the generateLegend method is working because my (generic) legend shows in my div.
Here is my code:
The text was updated successfully, but these errors were encountered: