Angular Funnel - Rearrange Legend Items
Although the legend's layout is virtually universal, in some cases, you may need to slightly adjust it, for example, rearrange legend items. You can learn how to do it from the following instructions.
- Choose legend orientation
Depending on whether the legend is oriented vertically or horizontally, the Funnel arranges legend items in columns or in rows. To change the legend orientation, use the orientation property.
HTML
TypeScript
- <dx-funnel ...>
- <dxo-legend
- orientation="vertical"> <!-- or "horizontal" -->
- </dxo-legend>
- </dx-funnel>
- import { DxFunnelModule } from "devextreme-angular";
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxFunnelModule
- ],
- // ...
- })
Code
- [note] To center a horizontally-oriented legend, assign *"center"* to the [horizontalAlignment](/api-reference/10%20UI%20Components/BaseLegend/horizontalAlignment.md '/Documentation/ApiReference/UI_Components/dxFunnel/Configuration/legend/#horizontalAlignment') property. For details on the legend's location, refer to the [Relocate the Legend](/concepts/05%20UI%20Components/Funnel/35%20Legend/10%20Relocate%20the%20Legend.md '/Documentation/Guide/UI_Components/Funnel/Legend/Relocate_the_Legend/') topic.
- Set the number of columns or rows
To distribute all legend items between several columns (in a vertically-oriented legend) or rows (in a horizontally-oriented legend), set the columnCount or rowCount property respectively.
HTML
TypeScript
- <dx-funnel ...>
- <dxo-legend ...
- [columnCount]="3">
- <!-- [rowCount]="2"> -->
- </dxo-legend>
- </dx-funnel>
- import { DxFunnelModule } from "devextreme-angular";
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxFunnelModule
- ],
- // ...
- })
- Adjust the empty space between columns and rows
Regardless of the legend orientation, you can adjust the empty space between columns and rows using the columnItemSpacing and rowItemSpacing properties respectively.
HTML
TypeScript
- <dx-funnel ...>
- <dxo-legend ...
- [columnItemSpacing]="20"
- [rowItemSpacing]="30">
- </dxo-legend>
- </dx-funnel>
- import { DxFunnelModule } from "devextreme-angular";
- // ...
- export class AppComponent {
- // ...
- }
- @NgModule({
- imports: [
- // ...
- DxFunnelModule
- ],
- // ...
- })
Below, you can try out all the mentioned properties in action.
Embedded applications are not available for the selected DevExtreme version (v25.1).
We recommend that you upgrade to the most recent version of DevExtreme to access the latest features, bug fixes, and security updates.