Skip to main content
All docs
V24.2

DxSankey.LinkClick Event

Fires when a user clicks a DxSankey link.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<SankeyLinkClickEventArgs> LinkClick { get; set; }

Event Data

The LinkClick event's data class is SankeyLinkClickEventArgs. The following properties provide information specific to this event:

Property Description
Connection Returns the clicked link and its associated nodes.

Remarks

Handle the LinkClick event to respond to clicks on links.

The following code snippet handles the LinkClick event and displays information about the clicked link and associated nodes:

<DxSankey Data="@Data"
          Width="100%"
          Height="440px"
          LinkClick="@OnLinkClick"
          SourceFieldName="Source"
          TargetFieldName="Target"
          WeightFieldName="Weight">
    <DxSankeyNodeSettings Width="8" Spacing="30" />
    <DxSankeyLinkSettings ColorMode="SankeyLinkColorMode.Gradient" />
    <DxTitleSettings Text="Commodity Turnover" />
</DxSankey>

@Message

@code {
    IEnumerable<SankeyDataPoint> Data = Enumerable.Empty<SankeyDataPoint>();
    protected override void OnInitialized() {
        Data = GenerateData();
    }

    string Message { get; set; }
    void OnLinkClick(SankeyLinkClickEventArgs args) {
        var connection = args.Connection;
        Message = "The source node: " + connection.SourceNode + ". " +
                  "The target node: " + connection.TargetNode + ". " +
                  "The link weight: " + connection.Weight + ".";
    }
}

DxSankey - Handle Link Clicks

See Also