Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxChartAnnotationBase<T>.HorizontalOffset Property

Specifies the annotation’s horizontal offset.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public double HorizontalOffset { get; set; }

#Property Value

Type Description
Double

The offset in pixels.

#Remarks

The HorizontalOffset property value shifts the annotation horizontally from its initial position. A positive value shifts the annotation to the right, a negative value – to the left.

The following example shifts the annotation horizontally or vertically based on the values of spin editors:

razor
<DxChart Data="@DataSource">
    @* ... *@
    <DxChartLineSeries ValueField="@((ApplePrice i) => i.Close)"
                       ArgumentField="@((ApplePrice i) => i.Date)"
                       Name="AAPL" />
    <DxChartAnnotation Argument="new DateTime(2021, 4, 20)"
                       Series="AAPL"
                       Text="Fifth generation of iPad Pro"
                       HorizontalOffset="@CurrentHorizontalOffset"
                       VerticalOffset="@CurrentVerticalOffset" />
</DxChart>

@code {
    double CurrentHorizontalOffset = 0;
    double CurrentVerticalOffset = 0;
    // ...
}

Refer to the following section for more information about annotations: Annotations in Blazor Charts.

See Also