feat: allow hiding legends

This commit is contained in:
Shivam Mishra 2021-02-22 03:17:07 +00:00 committed by GitHub
parent 263f38c9ec
commit 067f5ea7f8

View File

@ -35,7 +35,7 @@ export default class BaseChart {
this.config = { this.config = {
showTooltip: 1, // calculate showTooltip: 1, // calculate
showLegend: 1, // calculate showLegend: (typeof options.showLegend !== 'undefined') ? options.showLegend : 1,
isNavigable: options.isNavigable || 0, isNavigable: options.isNavigable || 0,
animate: (typeof options.animate !== 'undefined') ? options.animate : 1, animate: (typeof options.animate !== 'undefined') ? options.animate : 1,
truncateLegends: options.truncateLegends || 1 truncateLegends: options.truncateLegends || 1
@ -158,7 +158,9 @@ export default class BaseChart {
setTimeout(() => { this.update(this.data); }, this.initTimeout); setTimeout(() => { this.update(this.data); }, this.initTimeout);
} }
this.renderLegend(); if (this.config.showLegend) {
this.renderLegend();
}
this.setupNavigation(init); this.setupNavigation(init);
} }