How to change colors options in Highcharts programmatically? -


At the beginning of the upper chapters, I have only set one color array. I want to replace it with another array on chart hover event I am In other words the chart is the default monochromatic and after hover it becomes colorful.

  config = {colors: ["# C0C0C0"]}; Chart = $ ('# Chart'). Highchina Highchurch () $ ('# Chart'). Hover (function ({{chart.options.colors = ["# E84C3D", "# C1392B", "# D25400", "# E67F22", "# F39C11"]}, function () {chart.options.colors = ["# C0C0C0"]});  

Unfortunately this does not work, how do I do it?

You can set plot options:

plotOptions: {Column: {ColorByPoint: true}, series: {animation: false, events: {mouseover: function (e) {//console.log (chart.options); Var option = chart.options; If (options.colors [0]! = '# E84C3D') {/ options.colors = ['# E84C3D', '# C1392B', '# D25400', '# E67F22', '# F39C11']; Chart = new highchart Chart (option); }}, Mouseaut: function (e) {var option = chart.opop; If (options.colors [0]! = '# C0C0C0') {/ options.colors = ['# C0C0C0']; Chart = new highchart Chart (option); }}}}

demo


Comments