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:
Sample Links:
https://help.syncfusion.com/ug/js/default.htm#!documents/treemapelements.htm
https://js.syncfusion.com/demos/web/#!/azure/treemap/flatcollection