Angular Sankey - 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 UI component requires disabled pagination to prevent data from partitioning.
jQuery
$(function() { $("#sankeyContainer").dxSankey({ dataSource: new DevExpress.data.DataSource({ store: { type: 'odata', url: 'https://www.example.com/dataservices/odata/targetData', key: ['from', 'to'] }, paginate: false }), // ... }); });
Angular
<dx-sankey [dataSource]="sankeyDataSource"> <!-- ... --> </dx-sankey>
import { Component } from '@angular/core'; import 'devextreme/data/odata/store'; import DataSource from 'devextreme/data/data_source'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { sankeyDataSource = new DataSource({ store: { type: 'odata', url: 'https://www.example.com/dataservices/odata/targetData', key: ['from', 'to'] }, paginate: false }); }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxSankeyModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxSankeyModule ], providers: [ ], bootstrap: [AppComponent] }) export class AppModule { }
Vue
<template> <DxSankey :data-source="sankeyDataSource"> <!-- ... --> </DxSankey> </template> <script> import DxSankey from 'devextreme-vue/sankey'; import 'devextreme/data/odata/store'; import DataSource from 'devextreme/data/data_source'; const sankeyDataSource = new DataSource({ store: { type: 'odata', url: 'https://www.example.com/dataservices/odata/targetData', key: ['from', 'to'] }, paginate: false }); export default { components: { DxSankey }, data() { return { sankeyDataSource } } } </script>
React
import Sankey from 'devextreme-react/sankey'; import 'devextreme/data/odata/store'; import DataSource from 'devextreme/data/data_source'; const sankeyDataSource = new DataSource({ store: { type: 'odata', url: 'https://www.example.com/dataservices/odata/targetData', key: ['from', 'to'] }, paginate: false }); export default function App() { return ( <Sankey dataSource={sankeyDataSource}> {/* ... */} </Sankey> ); }
A 1-Click Solution for CRUD Web API Services with Role-based Access Control via EF Core & XPO
If you target .NET for your backend API, be sure to check out Web API Service and register your free copy today. The Solution Wizard scaffolds an OData v4 Web API Service (.NET 6+) with integrated authorization & CRUD operations powered by EF Core and our XPO ORM library. You can use OAuth2, JWT or custom authentication strategies alongside tools like Postman or Swagger (OpenAPI) for API testing.
The built-in Web API Service also filters out secured server data based on permissions granted to users. Advanced/enterprise functions include audit trail, endpoints to download reports, file attachments, check validation, obtain localized captions, etc.
To use the free Solution Wizard (which creates the Web API Service) run the Universal Component Installer from the DevExpress Download Manager.
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.