Back to Devexpress

ImageItem Class

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

latest6.3 KB
Original Source

ImageItem Class

An Image dashboard item that displays static images.

Declaration

ts
export class ImageItem extends DashboardItem

Remarks

The image dashboard item is used to add static images to a dashboard.

The following documentation is available:

Example

The following example shows how to create the Image dashboard item and provide a static image by URL. Create the ImageItem instance and use the ImageItem.urlPath property to specify a URL to a static image.

After you add the created dashboard item to the Dashboard.items collection, call the Dashboard.rebuildLayout method to rebuild the dashboard layout and display changes.

javascript
// Use the line below for a modular approach:
// import * as Model from 'devexpress-dashboard/model'
// Use the line below for an approach with global namespaces:
// var Model = DevExpress.Dashboard.Model;

public createImage(){
    var imageItem = new Model.ImageItem();
    imageItem.urlPath("https://www.devexpress.com/Products/NET/Dashboard/i/dashboard-tablet.png");
    imageItem.sizeMode("Squeeze");

    control.dashboard().items.push(imageItem);
    // ...
    control.dashboard().rebuildLayout();
}

Inherited Members

componentName

customProperties

disposed

itemType

name

parentContainer

showCaption

dispose

getInfo

getUniqueNamePrefix

Inheritance

SerializableModel TypedSerializableModel DashboardItem ImageItem

See Also

Images in Web Dashboard

constructor

Initializes a new instance of the ImageItem class.

Declaration

ts
constructor(
    modelJson?: any,
    serializer?: DevExpress.Analytics.Utils.ModelSerializer
)

Parameters

NameTypeDescription
modelJsonany

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

| | serializer | ModelSerializer |

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

|

Properties

horizontalAlignment Property

Declaration

ts
horizontalAlignment: ko.Observable<DevExpress.Dashboard.Model.ImageHorizontalAlignment>

Property Value

Type
Observable<ImageHorizontalAlignment>

image64 Property

Declaration

ts
image64: ko.Observable<string>

Property Value

Type
Observable<string>

imageAltText Property

Specifies a string that is used as alternative text for a static image

Declaration

ts
imageAltText: ko.Observable<string>

Property Value

TypeDescription
Observable<string>

The string value that is used as alternative text.

|

Remarks

You can specify the alternative text for a static image. Alt text makes images accessible to users who cannot see them, especially those using screen readers.

For information on how to set alt text in the UI, refer to the following help topic: Add Alternative Text for Image and Bound Image Items in Web.

imageType Property

Declaration

ts
imageType: ko.Observable<string>

Property Value

Type
Observable<string>

sizeMode Property

Declaration

ts
sizeMode: ko.Observable<DevExpress.Dashboard.Model.ImageSizeMode>

Property Value

Type
Observable<ImageSizeMode>

urlPath Property

Declaration

ts
urlPath: ko.Observable<string>

Property Value

Type
Observable<string>

verticalAlignment Property

Declaration

ts
verticalAlignment: ko.Observable<DevExpress.Dashboard.Model.ImageVerticalAlignment>

Property Value

Type
Observable<ImageVerticalAlignment>