Back to Devexpress

DxChartAxisStripLabel.HorizontalAlignment Property

blazor-devexpress-dot-blazor-dot-dxchartaxisstriplabel.md

latest3.2 KB
Original Source

DxChartAxisStripLabel.HorizontalAlignment Property

Specifies the horizontal alignment for the axis strip label.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(ChartStripLabelHorizontalAlignment.Auto)]
[Parameter]
public ChartStripLabelHorizontalAlignment HorizontalAlignment { get; set; }

Property Value

TypeDefaultDescription
ChartStripLabelHorizontalAlignmentAuto

An enumeration value.

|

Available values:

NameDescription
Auto

Left alignment for horizontal strips or center alignment for vertical strips.

| | Left |

Left alignment.

| | Center |

Center alignment.

| | Right |

Right alighnment.

|

Remarks

Specify the HorizontalAlignment property to align the strip label horizontally.

Note

The default Auto value aligns labels at the left edge of horizontal axis strips and at the center of vertical strips.

The following example uses drop-down menus to change strip label alignment:

razor
<DxChart Data="@DataSource" Width="100%" CustomizeSeriesPoint="@CustomizePoint">
    <DxChartTitle Text="Temperature (high) in September, °F" />
    <DxChartLegend Visible="false" />
    <DxChartSplineSeries ArgumentField="@((TemperatureData s) => s.Date)"
                         ValueField="@((TemperatureData s) => s.Temperature)"
                         Color="@SeriesColor">
        <DxChartSeriesLabel FormatPattern="{value:#}°F" />
    </DxChartSplineSeries>
    <DxChartValueAxis>
        <DxChartAxisStrip StartValue="@HighAverage" Color="rgba(255, 155, 85, 0.15)">
            <DxChartAxisStripLabel Text="Above average high"
                                   HorizontalAlignment="@CurrentHorizontalAlignment"
                                   VerticalAlignment="@CurrentVerticalAlignment">
                <DxChartFont Color="@HighAverageColor" Weight="500" Size="14" />
            </DxChartAxisStripLabel>
        </DxChartAxisStrip>
        <DxChartAxisStrip EndValue="LowAverage" Color="rgba(97, 153, 230, 0.1)">
            <DxChartAxisStripLabel Text="Below average low"
                                   HorizontalAlignment="@CurrentHorizontalAlignment"
                                   VerticalAlignment="@CurrentVerticalAlignment">
                <DxChartFont Color="@LowAverageColor" Weight="500" Size="14" />
            </DxChartAxisStripLabel>
        </DxChartAxisStrip>
    </DxChartValueAxis>
</DxChart>

@code {
    // ...
    ChartStripLabelHorizontalAlignment CurrentHorizontalAlignment = ChartStripLabelHorizontalAlignment.Auto;
    ChartStripLabelVerticalAlignment CurrentVerticalAlignment = ChartStripLabelVerticalAlignment.Auto;
}

See Also

DxChartAxisStripLabel Class

DxChartAxisStripLabel Members

DevExpress.Blazor Namespace