# toggleDataView method

Information noteSTABLE.   
  
This API is reliable and breaking changes are unlikely.

toggleDataView()

Creates a DataView object if it does not already exist and toggles the data view. Tells the visualization it has been resized and should re-paint.

Information noteDataView lets you toggle any QVisualization into a table that shows the data behind the chart.

## Version history

Version history

| Version state | Details |
| --- | --- |
| Introduced | Qlik Sense June 2018 |

## Disclaimer

The element that is provided as a parameter to the [QVisualization.show](https://help.qlik.com/en-US/sense-developer/November2025/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/VisualizationAPI/show-method.htm) method must have CSS property position set to relative and must not have any padding.

If these rules are not followed, the visualization object may not calculate its width and height correctly and you may not be able to scroll and navigate after toggling data view.

Proposed action

Wrap the element with another element. The wrapper can then be styled without any limitations.

## Example

```
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);
app.visualization.get('xGhjKl').then(function(vis){
  vis.show("QV01");
  vis.toggleDataView().then(function(toggled){
    if(toggled){
      document.getElementsByClassName('qv-st')[0].focus();
    }
  });
});
```