Heatmap colors incorrect when chart legend disabled

It seems the Heatmap chart type in Vaadin Charts 3.0.0 mangles the colors–whether using discrete Stops or minColor + maxColor on the ColorAxis–when the chart’s Legend is disabled. I’ve tested this by adding a button to the page that simply toggles Legend.enabled and redraws the chart.

Legend enabled: Colors display as intended
Legend disabled: Colors become “muted” (red turns to brownish-orange; orange turns to brown; green stays about the same)

In the end my goal is to produce a heatmap with no visible legend, or at least a legend with no numeric labels, but it seems overriding the Legend label formatter has no effect.

Hi Steve,

It looks like this is an issue in the underlying chart library.

As a workaround adding the following configuration to the color axis should make it work correctly when hiding the legend:

        config.getColorAxis().setStartOnTick(false);

        config.getColorAxis().setEndOnTick(false);

Hope this helps,

Guille

Hi Guillermo,

Thanks so much, this workaround is definitely effective as tested in https://github.com/skradel/vaadinheatmapdemo.

As an aside, one way to hide the legend data labels is to set a format string of " "; “” reverts to the default, and I didn’t have any luck with further efforts via a custom JS formatter.

Thanks,
Steve

Glad to hear it worked!