Using Grafana 11.3.1
I have pagination enabled on a table visualization on a Grafana dashboard and it works well. The panel is of fixed width. However, I would like to enable some dropdown for the user so they can configure the number of rows in each page. Kind of like this:
Is this doable?
In Grafana 11.3.1, enabling a dropdown for users to select the number of rows per page in a table visualization isn’t a built-in feature. However, there are a couple of workarounds you can use:
- Use a Dashboard Variable:
Create a variable (e.g., RowsPerPage
) that offers multiple options (like 10, 25, 50, 100). This variable can control a query limit or be passed to the table’s query to adjust the number of rows dynamically.Steps:
- Go to Dashboard Settings > Variables.
- Add a new variable:
- Type: Custom
- Values:
10, 25, 50, 100
- Set Label as
Rows per page
.
- Use this variable in your query (
LIMIT $RowsPerPage
for SQL datasources).
- Refresh the panel, and the table will update based on the selected number of rows.
- Custom Panel Plugin:
If you want a truly customizable solution with dropdowns inside the table, consider building a custom Grafana panel plugin. This is more complex but offers full control over the user interface.