Articles in this section
Category / Section

How to render the Legend in TreeMap?

1 min read

To render the JavaScript TreeMap Legend, follow the steps given:

Step 1:

Create a TreeMap sample and include the necessary script files.

Step 2:

You can represent the color value of the leaf nodes by using the treeMapLegend. This Legend is appropriate only for the TreeMap whose leaf nodes are colored by using the rangeColorMapping.

You can set showLegend API value to true to enable the Legend visibility.

JS

 $(“#treemap”).ejTreeMap({
 showLegend:true
});

 

JS

<script type="text/javascript">
       jQuery(function ($) {
           $("#treemap").ejTreeMap
                              .  .   .
                       showLegend: true
                            .  .  .
});
});
</script>

 

The following screenshot represents the Legend visibility:

Legend visibility in Treemap

 

Sample Links:

https://help.syncfusion.com/ug/js/default.htm#!documents/treemapelements.htm

https://js.syncfusion.com/demos/web/#!/azure/treemap/flatcollection

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied