VisualDescriptor class
A Power BI visual within a page
Properties
layout | The visual layout: position, size and visibility. |
name | The visual name |
page | The parent Power BI page that contains this visual |
title | The visual title |
type | The visual type |
Methods
clone(IClone |
Clone existing visual to a new instance. |
export |
Exports Visual data. Can export up to 30K rows. |
get |
Gets all visual level filters of the current visual.
|
get |
Get slicer state. Works only for visuals of type slicer.
|
get |
Get insights for single visual
|
move |
Updates the position of a visual.
|
remove |
Removes all filters from the current visual.
|
resize |
Resize a visual.
|
set |
Sets the filters on the current visual to 'filters'.
|
set |
Set slicer state. Works only for visuals of type slicer. |
set |
Updates the display state of a visual.
|
sort |
Sort a visual by dataField and direction. |
update |
Update the filters for the current visual according to the operation: Add, replace all, replace by target or remove.
|
Property Details
layout
The visual layout: position, size and visibility.
layout: IVisualLayout
Property Value
name
The visual name
name: string
Property Value
string
page
title
The visual title
title: string
Property Value
string
type
The visual type
type: string
Property Value
string
Method Details
clone(ICloneVisualRequest)
Clone existing visual to a new instance.
function clone(request?: ICloneVisualRequest): Promise<ICloneVisualResponse>
Parameters
- request
- ICloneVisualRequest
Returns
Promise<ICloneVisualResponse>
exportData(ExportDataType, number)
Exports Visual data. Can export up to 30K rows.
function exportData(exportDataType?: ExportDataType, rows?: number): Promise<IExportDataResult>
Parameters
- exportDataType
- ExportDataType
- rows
-
number
Returns
Promise<IExportDataResult>
getFilters()
Gets all visual level filters of the current visual.
visual.getFilters()
.then(filters => { ... });
function getFilters(): Promise<IFilter[]>
Returns
Promise<IFilter[]>
getSlicerState()
Get slicer state. Works only for visuals of type slicer.
visual.getSlicerState()
.then(state => { ... });
function getSlicerState(): Promise<ISlicerState>
Returns
Promise<ISlicerState>
getSmartNarrativeInsights()
Get insights for single visual
visual.getSmartNarrativeInsights();
function getSmartNarrativeInsights(): Promise<ISmartNarratives>
Returns
Promise<ISmartNarratives>
moveVisual(number, number, number)
Updates the position of a visual.
visual.moveVisual(x, y, z)
.catch(error => { ... });
function moveVisual(x: number, y: number, z?: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- x
-
number
- y
-
number
- z
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
removeFilters()
Removes all filters from the current visual.
visual.removeFilters();
function removeFilters(): Promise<IHttpPostMessageResponse<void>>
Returns
Promise<IHttpPostMessageResponse<void>>
resizeVisual(number, number)
Resize a visual.
visual.resizeVisual(width, height)
.catch(error => { ... });
function resizeVisual(width: number, height: number): Promise<IHttpPostMessageResponse<void>>
Parameters
- width
-
number
- height
-
number
Returns
Promise<IHttpPostMessageResponse<void>>
setFilters(IFilter[])
Sets the filters on the current visual to 'filters'.
visual.setFilters(filters);
.catch(errors => { ... });
function setFilters(filters: IFilter[]): Promise<IHttpPostMessageResponse<void>>
Parameters
- filters
-
IFilter[]
Returns
Promise<IHttpPostMessageResponse<void>>
setSlicerState(ISlicerState)
Set slicer state. Works only for visuals of type slicer.
function setSlicerState(state: ISlicerState): Promise<IHttpPostMessageResponse<void>>
Parameters
- state
- ISlicerState
Returns
Promise<IHttpPostMessageResponse<void>>
setVisualDisplayState(VisualContainerDisplayMode)
Updates the display state of a visual.
visual.setVisualDisplayState(displayState)
.catch(error => { ... });
function setVisualDisplayState(displayState: VisualContainerDisplayMode): Promise<IHttpPostMessageResponse<void>>
Parameters
- displayState
- VisualContainerDisplayMode
Returns
Promise<IHttpPostMessageResponse<void>>
sortBy(ISortByVisualRequest)
Sort a visual by dataField and direction.
function sortBy(request: ISortByVisualRequest): Promise<IHttpPostMessageResponse<void>>
Parameters
- request
- ISortByVisualRequest
Returns
Promise<IHttpPostMessageResponse<void>>
updateFilters(FiltersOperations, IFilter[])
Update the filters for the current visual according to the operation: Add, replace all, replace by target or remove.
visual.updateFilters(FiltersOperations.Add, filters)
.catch(errors => { ... });
function updateFilters(operation: FiltersOperations, filters?: IFilter[]): Promise<IHttpPostMessageResponse<void>>
Parameters
- operation
- FiltersOperations
- filters
-
IFilter[]
Returns
Promise<IHttpPostMessageResponse<void>>