Skip to content

Legend not showing when values are var(...) #2013

Answered by Fil
vincent-octo asked this question in Q&A
Discussion options

You must be logged in to vote

When the values are passed as literal colors, there is no color scale, and as a consequence no legend.

to fix, you could try using "sex" again, with something like this for the color option:

color: {
  legend: true,
  domain: ["FEMALE", "MALE", null],
  range: ["var(--female)", "var(--male)", "var(--null)"]
},

Replies: 1 comment 2 replies

Comment options

Fil
Mar 7, 2024
Collaborator

You must be logged in to vote
2 replies
@vincent-octo
Comment options

@Fil
Comment options

Fil Mar 8, 2024
Collaborator

Answer selected by vincent-octo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2012 on March 07, 2024 11:26.