mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 10:21:52 +01:00
Merge pull request #154 from TechMiX/fixGraphLegendBug
Fix graph legend bug on resize
This commit is contained in:
commit
1e39daafb3
@ -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…
Reference in New Issue
Block a user