Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ShunOtake
New Member

Coding visualize formatting to upload the image file for visual background image

I try to develop the Custom Visual and I want to upload the image file for visual background image.

But I can not understand coding to upload the image file by visualize formatting.
Please tell me the code.

ShunOtake_0-1707186146415.png

This my code.

setting.ts

------------------------------------------------------------

// Background Image
export class BgImageSettings extends FormattingSettingsCard {

public bgImage = new formattingSettings.ImageUpload({
name: "bgImage",
displayName: "Image File",
value: null,
visible: true
});

name: string = "bgCard";
displayName: string = "Background";
analyticsPane: boolean = false;
visible: boolean = true;
slices: Array<FormattingSettingsSlice> = [this.bgImage];
}

------------------------------------------------------------

 

capabilities.json
------------------------------------------------------------

"objects": {
"bgCard": {
"properties": {
"bgImage": {
"type": {
"text": true
}
}
}
},
------------------------------------------------------------

 

When I run the Custom Visual and upload the image file,

the charactor type is entered in the variable that contains "visualSettings.bg.bgImage.value".

Please show blow image.

ShunOtake_1-1707186731036.png

 

0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors