This sample visualizes the sales of cars across various countries in 2017 by rendering the countries at the top level and car manufacturing companies as leaf items.
In this example, you can see how to render a TreeMap with the provided data source. The palette color is applied to the items in TreeMap. The default legend is enabled in this example to represent the items at the top level.
Tooltip is enabled in this example. To see the tooltip in action, hover the mouse over an item or tap an item in touch enabled devices.
Injecting Module
TreeMap component features are segregated into individual feature-wise modules. To use a tooltip, inject the Tooltip
module using the TreeMap.Inject(TreeMapTooltip)
method, and use a legend by injecting the Legend
module using the TreeMap.Inject(TreeMapLegend)
method.