New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Series legend items don't display in the legend when colorAxis.showInLegend is false #8140

Closed
kamilkulig opened this Issue Apr 6, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@kamilkulig
Contributor

kamilkulig commented Apr 6, 2018

Expected behaviour

Series legend items should normally appear in the legend when colorAxis.showInLegend is false .

Actual behaviour

Legend is empty.

Live demo

http://jsfiddle.net/BlackLabel/a1v5v4ps/

Product version

Highcharts 6.0.7

@kamilkulig kamilkulig changed the title from Series don't display in the legend when colorAxis.showInLegend is false to Series legend items don't display in the legend when colorAxis.showInLegend is false Apr 6, 2018

@kamilkulig

This comment has been minimized.

Contributor

kamilkulig commented Apr 6, 2018

Internal note:
I suppose that this issue occurs because the code responsible for hiding legend items:
lines 990-993 in modules/heatmap.src.js :

                    // Don't add the color axis' series
                    each(colorAxis.series, function(series) {
                        series.options.showInLegend = false;
                    });

is not included in the scope of the if condition that precedes it:

if (colorAxis.options.showInLegend) {
       // Data classes
      (...)

Workaround: http://jsfiddle.net/BlackLabel/ebwsxo47/

@TorsteinHonsi

This comment has been minimized.

Collaborator

TorsteinHonsi commented Apr 16, 2018

I don't get it... Isn't it expected that the color axis is hidden from the legend when colorAxis.showInLegend is false?

@pawelfus

This comment has been minimized.

Contributor

pawelfus commented Apr 17, 2018

That's correct, but when colorAxis is hidden in the legend, default legend should show up: http://jsfiddle.net/BlackLabel/a1v5v4ps/25/ (bugfix branch) vs http://jsfiddle.net/BlackLabel/a1v5v4ps/ (v6.1.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment