Back to Devexpress

DxPieChart<T>.SegmentDirection Property

blazor-devexpress-dot-blazor-dot-dxpiechart-1-22eed46d.md

latest2.4 KB
Original Source

DxPieChart<T>.SegmentDirection Property

Specifies the direction in which the chart arranges series slices.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(PieChartSegmentDirection.Clockwise)]
[Parameter]
public PieChartSegmentDirection SegmentDirection { get; set; }

Property Value

TypeDefaultDescription
PieChartSegmentDirectionClockwise

An enumeration value.

|

Available values:

NameDescription
Clockwise

Arranges series slices clockwise.

| | CounterClockwise |

Arranges series slices counterclockwise.

|

Remarks

Use the SegmentDirection property to arrange series slices clockwise or counterclockwise.

The following code snippet changes the slice direction from Clockwise to CounterClockwise:

razor
<DxPieChart Data="@SalesData"
            SegmentDirection="PieChartSegmentDirection.CounterClockwise"
            T="SaleInfo">
    <DxPieChartSeries T="SaleInfo"
                      TArgument="string"
                      TValue="double"
                      ValueField="si => si.Amount"
                      ArgumentField="si => si.Region"
                      SummaryMethod="Enumerable.Sum">
        <DxChartSeriesLabel Visible="showLabels"
                            Position="labelPosition"
                            ValueFormat="ChartElementFormat.Thousands(1)">
            <DxChartSeriesLabelConnector Visible="true" />
        </DxChartSeriesLabel>
    </DxPieChartSeries>
    @* ... *@
</DxPieChart>

@code {
    IEnumerable<SaleInfo> SalesData;
    bool showLabels = true;
    RelativePosition labelPosition = RelativePosition.Outside;

    protected override async Task OnInitializedAsync() {
        SalesData = await Sales.GetSalesAsync();
    }
}

For additional information on how to arrange series slices, refer to the following topic: DxPieChart - Slice Layout.

See Also

DxPieChart<T> Class

DxPieChart<T> Members

DevExpress.Blazor Namespace