The legend block

The legend block contains information on how the legend will be displayed for this visualization.

Take a look at the legends section to see how it works.

These are the fields that each legend block can contain:

Field nameDescription

displayName

Optional. In categorical visualizations, a dictionary that maps from each category to what will be displayed on the legend. In numeric or heatmap visualizations, a dictionary that maps from the index of each class to what will be displayed on the legend.

Example of a categorical legend
"legend": {
  "displayName": {
    "category-1": "Category 1",
    "category-2": "Category 2"
  }
}
Example of a numerical legend
"legend": {
  "displayName": {
    "0": "-0.5", 
    "1": "0.5"
  }
}

Last updated