Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can change the type of an existing visual in a Power BI report, such as changing a bar chart into a pie chart. See a list of available out-of-the-box visual types.
How to change an existing visual type using the API
Use the changeType method and specify the desired type.
changeType(visualType: string): Promise<void>
Code example
The following code example shows how to change an existing visual type to a pieChart type.
await visual.changeType('pieChart');
Considerations and limitations
changeTypewill fail if the target visual type is not installed.- Different visual types have different data binding rules. If any data fields were applied to a visual and
changeTypeis used, then the data fields might be mapped to a differentdataRoleif such mapping is defined on the visual type metadata. If no such mapping exists between the visual types,changeTypefails. See Visual data binding to learn more.