Open bl99 opened 5 years ago
check if this works with SVG-Generator
scheme, e.g. template001.js:
// call this in chart.events.load: function () {onLoadFunction(this);}
var onLoadFunction = function (chart) {
//remove default function for credits-link
chart.credits.element.onclick = function () { };
//for top-left legends with no x defined: move legend to x position of first yAxis
if (chart['legend']['options']['align'] == 'left' && chart['legend']['options']['verticalAlign'] == 'top' && chart['legend']['options']['x'] == 0) {
chart.update({
legend: {
x: chart.yAxis[0].left - chart.spacingBox.x - chart.legend.padding
}
});
}
};
(function () {
return {
chart: {
events: {
load: function () {
onLoadFunction(this);
}
}
},
[...]
Move content of function from chart.events.load to separate function onLoadFunction() which can be called in chart-templates, e.g. when there are chart-specific functions in chart-templates that would override chart.events.load.