Skip to content
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
Assignees

Comments

@kamilkulig
Copy link
Contributor

@kamilkulig 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 Series don't display in the legend when colorAxis.showInLegend is false Series legend items don't display in the legend when colorAxis.showInLegend is false Apr 6, 2018
@kamilkulig
Copy link
Contributor Author

@kamilkulig 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
Copy link
Collaborator

@TorsteinHonsi 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
Copy link
Contributor

@pawelfus 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.