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
The page you are viewing does not exist in version 18.1.
17.2
The page you are viewing does not exist in version 17.2.
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery - OData Service

To bind the Sankey to data from an OData service, use the ODataStore. You should declare it inside the DataSource configuration object because the Sankey widget requires disabled pagination to prevent data from partitioning.

jQuery
JavaScript
$(function() {
    $("#sankeyContainer").dxSankey({
        dataSource: new DevExpress.data.DataSource({
            store: {
                type: "odata",
                url: "http://www.example.com/dataservices/odata/targetData",
                key: ["from", "to"]
            },
            paginate: false
        }),
        sourceField: "from",
        targetField: "to",
        weightField: "amount"
    });
});
Angular
TypeScript
HTML
import { DxSankeyModule } from "devextreme-angular";
import "devextreme/data/odata/store";
import DataSource from "devextreme/data/data_source";
// ...
export class AppComponent {
    sankeyDataSource: DataSource = new DataSource({
        store: {
            type: "odata",
            url: "http://www.example.com/dataservices/odata/targetData",
            key: ["from", "to"]
        },
        paginate: false
    });
}
@NgModule({
    imports: [
        // ...
        DxSankeyModule
    ],
    // ...
})
<dx-sankey
    [dataSource]="sankeyDataSource"
    sourceField="from"
    targetField="to"
    weightField="amount">
</dx-sankey>

The DataSource can also be used for data processing. In the following example, it is used to filter data:

jQuery
JavaScript
$(function() {
    $("#sankeyContainer").dxSankey({
        dataSource: new DevExpress.data.DataSource({
            store: {
                type: "odata",
                url: "http://www.example.com/dataservices/odata/targetData",
                key: ["from", "to"]
            },
            paginate: false,
            filter: [
                [ "amount", ">=", 6 ],
                [ "amount", "<=", 8 ]
            ]
        }),
        sourceField: "from",
        targetField: "to",
        weightField: "amount"
    });
});
Angular
TypeScript
HTML
import { DxSankeyModule } from "devextreme-angular";
import "devextreme/data/odata/store";
import DataSource from "devextreme/data/data_source";
// ...
export class AppComponent {
    sankeyDataSource: DataSource = new DataSource({
        store: {
            type: "odata",
            url: "http://www.example.com/dataservices/odata/targetData",
            key: ["from", "to"]
        },
        paginate: false,
        filter: [
            [ "amount", ">=", 6 ],
            [ "amount", "<=", 8 ]
        ]
    });
}
@NgModule({
    imports: [
        // ...
        DxSankeyModule
    ],
    // ...
})
<dx-sankey
    [dataSource]="sankeyDataSource"
    sourceField="from"
    targetField="to"
    weightField="amount">
</dx-sankey>
See Also