Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Changing the hover color in a Vaadin Charts heatmap
Is there a way to change the hover color or other effects in a Charts heatmap? I've tried achieving this through the States object of PlotOptionsHeatmap (com.vaadin.addon.charts.model.PlotOptionsHeatmap.getStates().getHover().setFillColor(Color color)), but this did nothing.
Hi Niko,
Sorry to hear that you're having issues with Charts.
Your current approach seems right to me. Would you mind creating an issue in https://dev.vaadin.com/ regarding this?
Regards
Thank you Guillermo, the issue ticket can be found in https://dev.vaadin.com/ticket/19763
As a temporary workaround while the issue is not fixed and released you can extend the Hover class like this:
public class HoverWithColor extends Hover {
private Color color;
public HoverWithColor() {
}
/**
* @see #setColor(Color)
*/
public Color getColor() {
return color;
}
/**
* The color of the marker in hover state.
*/
public void setColor(Color color) {
this.color = color;
}
}
And then use it in your PlotOptionsHeatmap:
HoverWithColor hoverWithColor = new HoverWithColor();
hoverWithColor.setColor(SolidColor.YELLOW);
plotOptionsHeatmap.getStates().setHover(hoverWithColor);
config.setPlotOptions(plotOptionsHeatmap);
Hope this helps in the meantime,
Guille