Back to Devexpress

LayoutDimensionOptions Class

dashboard-js-devexpress-dot-dashboard-dot-model-ecf813ee.md

latest4.1 KB
Original Source

LayoutDimensionOptions Class

Contains settings that allow you to adjust the height and width of a dashboard surface.

Declaration

ts
export class LayoutDimensionOptions extends SerializableModel

Remarks

The LayoutOptions.height and LayoutOptions.width properties return the LayoutDimensionOptions object that contains settings for the width and height dimensions of a dashboard surface.

The following code snippet specifies the height and aligns the dashboard’s content horizontally:

Handle the DashboardControlOptions.onDashboardInitializing event and call the custom setLayout function:

js
function setLayout(e) {
    if (e.dashboard.id == "dashboard2") {
        e.dashboard.layoutOptions.width.mode("Auto");
        e.dashboard.layoutOptions.height.mode("Fixed");
        e.dashboard.layoutOptions.height.value(3000);
    }

Inherited Members

disposed

Inheritance

SerializableModel LayoutDimensionOptions

constructor

Initializes a new instance of the LayoutDimensionOptions class with specified settings.

Declaration

ts
constructor(
    model?: any,
    serializer?: DevExpress.Analytics.Utils.IModelSerializer,
    info?: DevExpress.Analytics.Utils.ISerializationInfoArray
)

Parameters

NameTypeDescription
modelany

A layout dimension model.

| | serializer | IModelSerializer |

An object used for dashboard deserialization. Do not pass this parameter directly.

| | info | ISerializationInfoArray |

An array of objects that provide serialization info.

|

Properties

mode Property

Specifies whether a dashboard surface‘s height or width is fixed or adjusted to fit content.

Declaration

ts
mode: ko.Observable<DevExpress.Dashboard.Model.LayoutDimensionMode>

Property Value

TypeDescription
Observable<LayoutDimensionMode>

The dashboard layout mode.

|

Remarks

Set the mode property to Fixed and use the value property to specify the dashboard surface’s height or width value in pixels. If the mode property is set to Auto, the dashboard dimension is automatically calculated to fit content.

value Property

Specifies a value of a dashboard surface‘s dimension.

Declaration

ts
value: ko.Observable<number>

Property Value

TypeDescription
Observable<number>

A value of the height or width dimension.

|

Remarks

Set the mode property to Fixed and use the value property to specify the dashboard surface’s height or width value in pixels. If the mode property is set to Auto, the dashboard dimension is automatically calculated to fit content.