All docs
V19.1
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery - 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 option.

    jQuery
    JavaScript
    $(function() {
        $("#funnelContainer").dxFunnel({
            // ...
            legend: {
                orientation: "vertical" // or "horizontal"
            }
        });
    });
    Angular
    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
        ],
        // ...
    })
    NOTE
    To center a horizontally-oriented legend, assign "center" to the horizontalAlignment option. For details on the legend's location, refer to the 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 option respectively.

    jQuery
    JavaScript
    $(function() {
        $("#funnelContainer").dxFunnel({
            // ...
            legend: {
                // ...
                columnCount: 3
                // rowCount: 2
            }
        });
    });
    Angular
    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 options respectively.

    jQuery
    JavaScript
    $(function() {
        $("#funnelContainer").dxFunnel({
            // ...
            legend: {
                // ...
                columnItemSpacing: 20,
                rowItemSpacing: 30
            }
        });
    });
    Angular
    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 options in action.

See Also