Back to Devexpress

DxChartBase.Width Property

blazor-devexpress-dot-blazor-dot-dxchartbase-13a16ad5.md

latest2.0 KB
Original Source

DxChartBase.Width Property

Specifies the chart component’s absolute or relative width.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public string Width { get; set; }

Property Value

TypeDescription
String

The chart’s width in CSS units.

|

Remarks

The chart stretches horizontally to occupy the entire parent container by width.

Use the Width and Height properties to specify a custom component size. The following code snippet sets the chart’s size to 75% of the parent component’s size.

razor
<div class="container">
    <DxChart Data="@forecasts" Width="75%" Height="75%"> @* Width = 699px; Height = 330px *@
        @* ... *@
    </DxChart>
</div>
css
.container {
    width: 932px; 
    height: 440px;
}

You can also specify a property value in absolute units, for example, pixels.

razor
<DxChart Data="@forecasts" Width="800px">
  @* ... *@
</DxChart>

If you set this property to a floating-point value, the chart uses the AwayFromZero operation to convert this value to the integer number that is treated as a value in pixels.

See Also

DxChartBase Class

DxChartBase Members

DevExpress.Blazor Namespace