Add interactive data visualizations to your Bubble app including charts, sparklines, gauges, and geographic maps with data overlays. This tutorial covers installing chart plugins, binding dynamic data from your database, building clickable dashboard elements that filter on interaction, and creating admin-facing analytics pages.
Overview: Adding Data Visualization in Bubble
This tutorial shows you how to go beyond basic tables and add rich data visualizations to your Bubble app. You will install chart plugins, connect them to live database data, build interactive dashboards where clicking a chart element filters related data, and create specialized visualizations like gauges and maps. Ideal for founders building analytics dashboards, admin panels, or reporting features.
Prerequisites
- A Bubble account with a new or existing app
- A Data Type with records to visualize (such as Sales, Users, or Orders)
- Basic familiarity with Bubble's Plugin and Design tabs
Step-by-step guide
Install a chart plugin from the Bubble marketplace
Install a chart plugin from the Bubble marketplace
Go to the Plugins tab and click Add plugins. Search for Chart Element or Apex Charts (a popular free option). Click Install. The plugin will add new visual elements to your element palette. Apex Charts provides bar charts, line charts, pie charts, donut charts, and area charts. For geographic maps, also install the Google Maps Extended plugin or Mapbox plugin.
Pro tip: Apex Charts is free and covers most use cases. Avoid installing multiple chart plugins since each plugin adds JavaScript overhead to every page load.
Expected result: The chart plugin is installed and chart elements appear in your element palette under the Plugins section.
Create a bar chart showing data from your database
Create a bar chart showing data from your database
On your dashboard page in the Design tab, click the element palette and drag a Chart element onto the canvas. Set the chart type to Bar. For the data source, set Categories (X-axis) to a list of labels such as months or product names. Set Values (Y-axis) to an expression like Do a Search for Sales grouped by Month, with the aggregation set to sum of Amount. Configure the chart colors in the element's Appearance settings. Set the chart title and axis labels in the element's properties.
Expected result: A bar chart appears showing your database data aggregated and labeled on both axes.
Build a line chart with time-series data
Build a line chart with time-series data
Add another Chart element and set the type to Line. Set the X-axis to date values, such as Do a Search for Orders sorted by Created Date, then use the created date values as categories formatted to the month or day level. Set the Y-axis to the corresponding numeric values like order amounts. For multiple lines, add additional data series (such as revenue vs expenses) by configuring multiple value sets in the chart element. Enable tooltips in the chart settings so hovering shows exact values.
Expected result: A line chart displays trends over time with labeled axes, tooltips, and optionally multiple data series.
Make charts interactive with click-to-filter behavior
Make charts interactive with click-to-filter behavior
To make clicking a chart element filter the rest of the page, set up a custom state on the page called Selected Category (text). In the chart element's properties, enable the click event. Create a workflow: When chart element is clicked, set the custom state Selected Category to the clicked category value. Then update a Repeating Group on the same page to include a constraint where Category equals the Selected Category custom state, with Ignore empty constraints checked. Now clicking a bar in the chart filters the table below it.
Expected result: Clicking a section of the chart updates a custom state that filters a Repeating Group or other data display on the page.
Add gauge and donut chart visualizations
Add gauge and donut chart visualizations
For a gauge showing a single metric (like percentage complete or current month revenue versus target), add a Chart element set to Radial or Gauge type. Set the value to a dynamic expression such as current month's revenue divided by the monthly target times 100. For a donut chart showing category distribution, set the type to Donut and bind the segments to a grouped search (such as Do a Search for Products grouped by Category with count aggregation). Configure the center text to show the total count.
Expected result: A gauge shows a single metric as a percentage of a target, and a donut chart shows category distribution with labeled segments.
Create a geographic data map
Create a geographic data map
For geographic data visualization, use the Google Maps Extended plugin or a Mapbox plugin element. Add the map element to your page and set its data source to Do a Search for records that have geographic address fields. The map will display markers for each record. Customize marker colors or icons based on data values using conditionals. Add a click event on markers to show a popup with the record's details. For heatmap-style visualization, use the heatmap layer option available in some map plugins.
Expected result: A map displays data-driven markers at geographic locations, with clickable markers showing record details.
Complete working example
1DATA VISUALIZATION DASHBOARD — WORKFLOW SUMMARY2=================================================34PLUGINS INSTALLED:5 - Apex Charts (or Chart Element)6 - Google Maps Extended (for geographic visualization)78PAGE: dashboard9 Custom states:10 - Selected Category (text)11 - Date Range Start (date)12 - Date Range End (date)1314CHART 1: Bar Chart (Revenue by Category)15 Type: Bar16 X-axis: Search Sales :group by Category → category names17 Y-axis: Search Sales :group by Category → sum of Amount18 Click event → Set state Selected Category1920CHART 2: Line Chart (Revenue Over Time)21 Type: Line22 X-axis: Search Orders :sorted by Created Date → months23 Y-axis: Search Orders :group by month → sum of Amount24 Tooltips: enabled2526CHART 3: Donut Chart (Product Distribution)27 Type: Donut28 Segments: Search Products :group by Category → count29 Center text: Total count3031CHART 4: Gauge (Monthly Target Progress)32 Type: Radial/Gauge33 Value: Current month revenue / Target * 1003435MAP: Geographic Data36 Plugin: Google Maps Extended37 Source: Search Locations (geographic address field)38 Markers: colored by data values39 Click event → Show popup with record details4041INTERACTIVE FILTERING:42 Workflow: Chart bar clicked43 1. Set state → Selected Category = clicked value44 Repeating Group constraint:45 Category = Selected Category (Ignore empty)4647DATE FILTER:48 Date pickers → Set state Date Range Start/End49 All chart sources constrained by date rangeCommon mistakes when adding data visualization in Bubble
Why it's a problem: Loading all records into a chart without aggregation
How to avoid: Use the group by operator to aggregate data before passing it to the chart. Group by month, category, or status to create meaningful summaries
Why it's a problem: Installing multiple chart plugins for different chart types
How to avoid: Use a single comprehensive plugin like Apex Charts that supports multiple chart types including bar, line, pie, donut, and radial
Why it's a problem: Not providing axis labels or legends on charts
How to avoid: Always configure chart titles, axis labels, and legends in the chart element's properties
Best practices
- Aggregate data using group by before binding to charts for readability and performance
- Use a single chart plugin to minimize JavaScript overhead across your app
- Add date range filters so users can control the time period shown in all charts
- Include tooltips on all charts so hovering reveals exact values
- Use consistent colors across charts for the same categories or data series
- Limit pie and donut charts to 5-7 segments maximum for readability
- Test chart rendering on mobile screens and adjust sizing for responsive layouts
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I want to build an analytics dashboard in Bubble.io with bar charts for revenue by category, a line chart for trends over time, a donut chart for distribution, and a gauge for target tracking. How should I set up the data sources and chart configurations?
Create a dashboard page with four charts: a bar chart showing sales by category, a line chart showing monthly revenue trends, a donut chart for product distribution, and a gauge showing progress toward a monthly target.
Frequently asked questions
Which chart plugin should I use in Bubble?
Apex Charts is the most popular free option and supports bar, line, area, pie, donut, radial, and scatter charts. For more advanced visualizations like Gantt charts or treemaps, consider paid plugins or embedding external tools via an iframe.
Can charts update in real time as data changes?
Yes. If the chart's data source is a live search expression, it will update automatically when the database changes. For charts using custom states, you need to refresh the state when data changes.
How do I export a chart as an image?
Some chart plugins include a download button option in their settings. Alternatively, add an HTML element with a JavaScript snippet that captures the chart element as a PNG using the html2canvas library.
Can I embed third-party visualization tools like Metabase?
Yes. Use an HTML element with an iframe tag pointing to your Metabase embed URL. This lets you use any external visualization tool within your Bubble app.
Can RapidDev help build advanced analytics dashboards?
Yes. RapidDev can help you build sophisticated analytics features including real-time dashboards, custom aggregation logic, predictive visualizations, and embedded reporting tools optimized for performance.
How do I handle large datasets in charts without performance issues?
Always aggregate data server-side using group by before binding to charts. Limit time-series charts to monthly or weekly granularity for large date ranges. Use Backend Workflows to pre-compute aggregations and store them in a summary Data Type.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation