mirror of
https://github.com/mempool/mempool.git
synced 2025-02-25 07:07:36 +01:00
fix legend bug on resize
This commit is contained in:
parent
5aa17e001c
commit
640a77e846
1 changed files with 5 additions and 3 deletions
|
@ -319,7 +319,11 @@ Chartist.plugins.legend = function (options: any) {
|
|||
|
||||
chart.on('created', function (data: any) {
|
||||
|
||||
if (isSelfUpdate)
|
||||
const useLabels = chart instanceof Chartist.Pie && chart.data.labels && chart.data.labels.length;
|
||||
const legendNames = getLegendNames(useLabels);
|
||||
var dirtyChartData = (chart.data.series.length < legendNames.length);
|
||||
|
||||
if (isSelfUpdate || dirtyChartData)
|
||||
return;
|
||||
|
||||
function removeLegendElement() {
|
||||
|
@ -476,8 +480,6 @@ Chartist.plugins.legend = function (options: any) {
|
|||
removeLegendElement();
|
||||
|
||||
const legendElement = createLegendElement();
|
||||
const useLabels = chart instanceof Chartist.Pie && chart.data.labels && chart.data.labels.length;
|
||||
const legendNames = getLegendNames(useLabels);
|
||||
const seriesMetadata = initSeriesMetadata(useLabels);
|
||||
const legends: any = [];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue