Highcharts: How do I change the legend location in

2019-09-18 13:43发布

问题:

I'm trying to export a chart to various formats. Although the chart looks okay when rendered by the browser, in the PDF/PNG/JPEG export the legend seems to be overlapping. What setting should I change/add to change the position of the legend?

回答1:

Exporting options can be set in chart's configuration: exporting.chartOptions.legend (API: http://api.highcharts.com/highcharts#exporting.chartOptions)

Example: http://jsfiddle.net/w8z1uq9s/

exporting: {
            chartOptions: {
                legend: {
                    y: 100,
                    x: -50
                }
            }
        },