Stan van der Bend
06/27/2024, 9:30 PMconst plugin = {
beforeInit(chart) {
// Get a reference to the original fit function
const originalFit = chart.legend.fit;
// Override the fit function
chart.legend.fit = function fit() {
// Call the original function and bind scope in order to use `this` correctly inside it
originalFit.bind(chart.legend)();
// Change the height as suggested in other answers
this.height += 15;
}
}
}
What I tried so far:
val plugin = obj {
beforeInit = { chart : dynamic ->
val fitValue = chart.legend.fit
chart.legend.fit = {
fitValue.bind(chart.legend)()
this.height += 50
}
}
}
Stan van der Bend
06/27/2024, 9:39 PMthis
refers to, the fix is:
chart.legend.fit = {
fitValue.bind(chart.legend)()
chart.legend.height += 50
}
turansky
06/29/2024, 12:08 PM