score:-2

not sure you find an answer yet or not but i found one link which is 101% useful to you even for future reference. so can you have a look please. i was searching for something else and i found this link and also got your question.

   [http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/members/series-update/][1]

let me know or accept my answer if this will help to you in any manner. cheers:)

score:0

here what works for me:

function changetype() {
  var series  = chart.series[0];
  var newtype = your_condition_here ? 'column' : 'bar';
  var dataarray = [],
      points = series.data;

  series.chart.addseries({
      type: newtype,
      name: series.name,
      color: series.color,
      data: series.options.data
  }, false);
  series.remove();
}

it creates new series using the new type and removes the old one.

free to add more options as you need.

hope it helps someone :)

score:0

you are able to update the chart type at the level of the chart. since you have set the type inside the chart attribute, you need to update the same attribute.

// initializing chart
let probchart = new highcharts.chart('container', {
  chart: { 
    type: "line"
  },
});

// updating chart type
probchart.update({
  chart: { type: "column" }
});

score:3

this works for me:

$.each(chart.series, function (key, series) {
    series.update(
        {type: 'bar'},
        false
    );
}

score:12

you can use inverted parameter in chart and update yaxis. http://jsfiddle.net/n9xkr/8/

$('#bar').click(function () {


    chart.inverted = true;
    chart.xaxis[0].update({}, false);
    chart.yaxis[0].update({}, false);
    chart.series[0].update({
        type: 'column'
    });

});

Related Query

More Query from same tag