Back to Devexpress

DxChartAxisStrip.PaddingLeftRight Property

blazor-devexpress-dot-blazor-dot-dxchartaxisstrip-acbc5d89.md

latest3.1 KB
Original Source

DxChartAxisStrip.PaddingLeftRight Property

Specifies the padding between the left or right strip edge and its label.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(10)]
[Parameter]
public double PaddingLeftRight { get; set; }

Property Value

TypeDefaultDescription
Double10

The padding in pixels.

|

Remarks

Based on the HorizontalAlignment property value, the PaddingLeftRight property moves the axis strip label to the left or right.

The following example uses spin editors to change paddings for axis strip labels:

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)"
                          PaddingLeftRight="@CurrentPaddingLeftRight"
                          PaddingTopBottom="@CurrentPaddingTopBottom">
            <DxChartAxisStripLabel Text="Above average high"
                                   HorizontalAlignment="ChartStripLabelHorizontalAlignment.Left"
                                   VerticalAlignment="ChartStripLabelVerticalAlignment.Top">
                <DxChartFont Color="@HighAverageColor" Weight="500" Size="14" />
            </DxChartAxisStripLabel>
        </DxChartAxisStrip>
        <DxChartAxisStrip EndValue="LowAverage"
                          Color="rgba(97, 153, 230, 0.1)"
                          PaddingLeftRight="@CurrentPaddingLeftRight"
                          PaddingTopBottom="@CurrentPaddingTopBottom">
            <DxChartAxisStripLabel Text="Below average low"
                                   HorizontalAlignment="ChartStripLabelHorizontalAlignment.Right"
                                   VerticalAlignment="ChartStripLabelVerticalAlignment.Bottom">
                <DxChartFont Color="@LowAverageColor" Weight="500" Size="14" />
            </DxChartAxisStripLabel>
        </DxChartAxisStrip>
    </DxChartValueAxis>
</DxChart>

@code {
    // ...
    double CurrentPaddingLeftRight = 10;
    double CurrentPaddingTopBottom = 10;
}

See Also

DxChartAxisStrip Class

DxChartAxisStrip Members

DevExpress.Blazor Namespace