Search code examples
ag-gridag-grid-react

Change hover color on all charts Ag-Grid


I'm currently trying out AG-Grid, and can't seem to find where to change the yellow hover color on the charts.

Take a look at the plnkr and hover over the doughnut chart and see what I mean.

I the docs I'm able to read that it should be

    item: {
      fill: 'red',
      stroke: 'maroon',
      strokeWidth: 4
    },
    series: {
        dimOpacity: 0.2,
        strokeWidth: 2
    }
}

But I can't seem to get it to work on all charts.

Any suggestions?

https://plnkr.co/edit/2e8RxPabCWKJdzsn?open=main.ts&preview


Solution

  • You may have been adding the highlight style to the wrong place. Try the following code which should highlight fill using red:

      pie: {
        series: {
          highlightStyle: {
            item: {
              fill: 'red',
              stroke: 'maroon',
              strokeWidth: 4,
            },
            series: {
              dimOpacity: 0.2,
              strokeWidth: 2,
            },
          },
          title: {
            enabled: false,
          },
          label: {
            enabled: false,
          },
        },
      },
    },
    

    Updated Plunker.