How can I have same hover point color in highchart

2019-09-17 03:20发布

问题:

I want to have same hover point color as when point was in hover off state. Plunker link here

For example: for success tasks I have green colored point so on hover also point color should be green but instead it turns blue. Please help

Code

plotOptions: {
    ...
    series: {
        cursor: 'pointer',
        dataGrouping: {
            enabled: false
        },
        marker: {
            radius: 4,
            states: {
                hover: {
                    fillColor: null
                }
            }
        },
        turboThreshold: 1000000
    }
},

回答1:

well as a roundabout to your problem you could try something like this

     plotOptions: {
      ....
      series: {
       cursor: 'pointer',
       dataGrouping: {
         enabled: false
       },
       marker: {
         radius: 4,
         states: {
           hover: {
             fillColor: function(){
               return true;
             }
           }
         }
       },
       turboThreshold: 1000000
     }
   },