Example of Legend in Angular TreeMap Component

undefined
US Presidential election result - 2016CaliforniaTexasNew YorkFloridaIllinoisPennsylvaniaOhioMichiganGeorgiaNorth CarolinaNew JerseyVirginiaWashingtonMassachusettsIndianaArizonaTennesseeMissouriMarylandWisconsinMinnesotaColoradoAlabamaSouth C...LouisianaKentuckyOregonOklaho...Conne...IowaMississi...ArkansasKansasUtahNevadaNew ...Wes...Neb...IdahoHawaiiMaineNew ...Rh...Mon...Del...So...Al...D...N...V... TrumpClinton
Properties
Type
Position

This sample visualizes USA president election results in the year 2016. Type of the legend can be changed by using the Legend Type in properties panel.

In this example, you can see the type of legend available in treemap. And we have applied equal color mapping based on certain value.

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 legend, inject the Legend module using the Treemap.Inject(TreeMapLegend) method.