Back to Devexpress

IChartSeriesLabel.RotationAngle Property

blazor-devexpress-dot-blazor-dot-ichartserieslabel-f88842c5.md

latest2.7 KB
Original Source

IChartSeriesLabel.RotationAngle Property

Specifies the rotation angle of series labels.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
double RotationAngle { get; set; }

Property Value

TypeDescription
Double

The rotation angle in degrees.

|

Remarks

IChartSeriesLabel properties allow you to configure point label settings. To access these settings, use the PointLabel property in a CustomizeSeriesPoint event handler.

Example

The following code snippet rotates visible series labels by the specified angle:

razor
<DxChart Data="@WeatherForecasts"
         CustomizeSeriesPoint="@PreparePointLabel"
         Width="100%">
    <DxChartTitle Text="Annual Weather in New York" />
    <DxChartLineSeries SummaryMethod="@(i => i.Average())"
                       ValueField="@((DetailedWeatherSummary i) => i.AverageTemperatureF)"
                       ArgumentField="@(i => new DateTime(2000, i.Date.Month, 1))"
                       Name="Temperature, F"
                       Filter="@((DetailedWeatherSummary i) => i.City == "NEW YORK")">
        <DxChartSeriesLabel Position="RelativePosition.Outside"
                            FormatPattern="{argument:MMMM}: {value:#.##} °F">
            <DxChartSeriesLabelConnector Visible="true"
                                        Width="3" />
            <DxChartFont Size="14" Weight="600" />
        </DxChartSeriesLabel>
    </DxChartLineSeries>
    @* ... *@
</DxChart>

@code {
    IEnumerable<DetailedWeatherSummary> WeatherForecasts;

    protected override async Task OnInitializedAsync() {
        WeatherForecasts = await WeatherSummaryDataProvider.GetDataAsync();
    }

    protected void PreparePointLabel(ChartSeriesPointCustomizationSettings pointSettings) {
        double value = (double)pointSettings.Point.Value;
        if (value > 50 && value < 70)
            pointSettings.PointLabel.Visible = true;
            pointSettings.PointLabel.RotationAngle = 90;
    }
}

See Also

IChartSeriesLabel Interface

IChartSeriesLabel Members

DevExpress.Blazor Namespace