0
votes

We are using Highcharts 8 and was wondering whether it is possible to change the chart type - for example from Column to Line, when resizing browser using the Responsive attribute.

We tried:

responsive: {
              rules: [{
                       condition: {
                            maxWidth: 500
                        },
                        chartOptions: {
                            type: 'line',
                            legend: {
                                align: 'center',
                                verticalAlign: 'bottom',
                                layout: 'horizontal'
                            }
                           
                        }
                    }]
                }

But, nothing happens.

1

1 Answers

1
votes

Change the type by: chartOptions.chart.type

    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                chart: {
                    type: 'line'
                },
                ...
            }
        }]
    }

Live demo: http://jsfiddle.net/BlackLabel/gv012eyc/

API Reference: https://api.highcharts.com/highcharts/chart.type