Преглед изворни кода

feat: allow hiding legends

pull/347/head
Shivam Mishra пре 4 година
committed by GitHub
родитељ
комит
067f5ea7f8
1 измењених фајлова са 5 додато и 3 уклоњено
  1. +5
    -3
      src/js/charts/BaseChart.js

+ 5
- 3
src/js/charts/BaseChart.js Прегледај датотеку

@@ -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
@@ -157,8 +157,10 @@ export default class BaseChart {
this.data = this.realData; this.data = this.realData;
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);
} }


Loading…
Откажи
Сачувај