Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have some codes written in javascript where any value less than 80 will cause the barchart's column color to become red. I have did it but there seems to be a bug whereas the column color change back to default color everytime I hover over the column.
E.g. Red become blue.
Below are my codes:

JavaScript
function (chart) {

               var max = 80;

               $.each(chart.series[2].data, function (i, data) {
                   if (data.y < max) {
                       data.graphic.attr({
                           fill: 'RED'
                       });
                       chart.series[0].data[i].graphic.attr({
                           fill: 'RED'
                       });
                       hover: { color: 'RED' };
                       chart.redraw();
                   }
               });
           }


What I have tried:

1. Tried to search for online solution but below link is the best I can get.
http://stackoverflow.com/questions/7414287/how-do-you-change-the-colour-of-each-category-within-a-highcharts-column-chart
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900