Documentation

Chart Builder - Data Visualization

Chart Builder

Quick Start

Create your first chart in under a minute:

  1. Open a collection and run a query or build an aggregation pipeline
  2. Click the "Create Chart" button to launch the Chart Builder
  3. Select a chart type from the left panel (e.g., Bar, Pie, or Line)
  4. Click "Auto Detect" to automatically map your data fields to chart axes
  5. Fine-tune the field mappings and add custom labels in the configuration panel
  6. Click "Save Chart" to add it to your workspace
Chart Builder interface showing chart type selector (left), live chart preview (center), and configuration panel (right)

What is the Chart Builder?

The Chart Builder is a powerful visualization tool that transforms MongoDB query results or aggregation pipeline outputs into interactive charts. Whether you're analyzing sales trends, monitoring metrics, exploring geographic data, or building business dashboards, the Chart Builder provides an intuitive interface to create professional visualizations without writing code.

Key Features

  • 20+ Chart Types - From basic bar and line charts to advanced visualizations like Sankey diagrams, geographic maps, and candlestick charts
  • Auto-Detection - Automatically detects field types (numeric, string, date, geographic) and suggests optimal field mappings
  • Live Preview - See your chart update in real-time as you adjust mappings and settings
  • Flexible Data Sources - Create charts from query results or aggregation pipeline outputs
  • Custom Labels - Add titles, subtitles, and axis labels to make your charts presentation-ready
  • Organized Storage - Save charts to folders and organize your visualization library
  • Query Editing - Modify the underlying query or aggregation pipeline directly from the Chart Builder

Available Chart Types

The Chart Builder supports a comprehensive range of visualization types, organized into four categories. Each chart type is optimized for different kinds of data and analysis scenarios.

Chart type dropdown menu showing all available chart types with icons

Basic Charts

Fundamental chart types for common data visualization needs:

  • Bar - Compare values across categories with vertical or horizontal bars
  • Line - Show trends and changes over time or continuous data
  • Area - Emphasize magnitude of change over time with filled areas
  • Pie - Display proportions and percentages of a whole
  • Donut - Similar to pie chart with a hollow center, better for multiple series
  • Scatter - Plot two numeric variables to identify correlations and patterns
  • Bubble - Scatter plot with a third dimension represented by bubble size

Advanced Analytics Charts

Sophisticated visualizations for complex data analysis:

  • Funnel - Visualize stages in a process and identify conversion drop-offs
  • Gauge - Display a single value within a defined range, like a speedometer
  • Heatmap - Show intensity or density using color gradients across two dimensions
  • Treemap - Display hierarchical data as nested rectangles sized by value
  • Sunburst - Circular hierarchical visualization showing relationships and proportions
  • Sankey - Flow diagram showing relationships and quantities between entities
  • Radar - Compare multiple variables on axes radiating from a center point

Time-Series Charts

Specialized charts for temporal data and financial analysis:

  • Timeline - Display events or data points along a chronological axis
  • Candlestick - Financial chart showing open, high, low, and close values (OHLC)
  • Calendar - Heatmap-style visualization organized by calendar dates

Geographic Charts

Map-based visualizations for location data:

  • Geo Map - Plot data on world, country, or regional maps using regions or boundaries
  • Geo Scatter - Display points on a map using latitude and longitude coordinates
  • Geo Heatmap - Show geographic data intensity using color gradients on maps

Creating a Chart

Charts are created from data sources - either query results or aggregation pipeline outputs. The Chart Builder provides multiple ways to access and configure your data.

Video CHBU03 Creating a Chart from Query Results - Step-by-step demonstration: (1) Run a query in Collection Activity to get data results, (2) Click the "Create Chart" button in the toolbar to launch the Chart Builder, (3) Select a chart type from the dropdown (e.g., Bar, Line, or Pie), (4) Click "Auto Detect" to automatically map data fields to chart axes, (5) Review the live preview to see your chart visualization, (6) Fine-tune field mappings as needed, (7) Enter a chart title and optional folder path for organization, (8) Click "Save Chart" to add it to your workspace.

Step 1: Access the Chart Builder

There are two main ways to open the Chart Builder:

  • From Collection Activity - After running a query, click the "Create Chart" button in the toolbar to visualize the results
  • From Aggregation Activity - After building a pipeline, click "Create Chart" to turn the aggregated data into a visualization
Create Chart button in Collection Activity toolbar

Step 2: Choose Your Chart Type

The chart type selector in the left panel displays all available visualization types. Click the dropdown to browse chart types, organized by category. Each type shows an icon and name to help you quickly identify the right visualization for your data.

Video CHBU05 Selecting Chart Type and Mapping Fields - Step-by-step demonstration: (1) Open the Chart Builder with data already loaded, (2) Click the chart type dropdown in the left panel, (3) Browse through available chart types (Bar, Line, Pie, Scatter, Geographic, etc.), (4) Select a chart type that suits your data (e.g., Bar chart for comparisons), (5) Use the data mapper panel to manually select fields for X-axis, Y-axis, and optional Series, (6) Watch the chart preview update in real-time as you change field mappings, (7) Try different chart types to see how the same data looks in various visualization formats, (8) Use "Auto Detect" to let the system intelligently suggest optimal field mappings.

Step 3: Understanding Your Data

The Chart Builder intelligently analyzes your actual data values to accurately detect field types:

  • Numeric Fields - Detected by examining actual values including MongoDB BSON types (Int32, Long, Double, Decimal128). Numbers suitable for measurements, counts, and values
  • String Fields - Text values suitable for categories, labels, and dimensions
  • Date Fields - Detected from Date objects and ISO date strings. Used for time-series analysis
  • Geographic Fields - Detected from GeoJSON objects or coordinate arrays. Used for map visualizations
  • Nested Fields - Arrays and embedded documents detected for complex data structures

The type detection examines your actual query results to ensure accurate field classification. If a field's type cannot be determined from the data, the system falls back to intelligent name-based heuristics (e.g., fields named "count", "total", or "amount" are assumed numeric). This two-layer approach ensures reliable auto-mapping even with diverse data schemas.

Field Mapping

Field mapping connects your MongoDB data fields to chart dimensions like axes, values, and categories. Different chart types require different field mappings based on their structure.

Data mapper panel showing field dropdowns and auto-detect button

Auto-Detection

Click the "Auto Detect" button to let the Chart Builder intelligently map your fields. The auto-detection algorithm:

  • Analyzes your actual data values to accurately determine field types
  • Matches fields to the requirements of your selected chart type
  • Falls back to name-based heuristics when data analysis is inconclusive
  • Provides a starting point that you can refine manually

Data Field Mapping Panel

The data mapper panel displays each field with a color-coded type badge indicating its detected type:

  • Blue (Number) - Numeric fields suitable for Y-axis values and calculations
  • Green (String) - Text fields for categories and labels
  • Purple (Date) - Date/time fields for X-axis in time-series charts
  • Teal (Geo) - Geographic fields for map-based visualizations
  • Orange (Object) - Nested documents and arrays

Common Field Mappings by Chart Type

Bar, Line, and Area Charts

Field Description Typical Data Type
X-Axis Categories or time periods String, Date
Y-Axis Numeric values to measure Numeric
Series Field to split data into multiple series (optional) String

Pie and Donut Charts

Field Description Typical Data Type
Category Labels for each pie slice String
Value Numeric value determining slice size Numeric

Scatter and Bubble Charts

Field Description Typical Data Type
X-Axis First numeric variable Numeric
Y-Axis Second numeric variable Numeric
Size Bubble size (bubble charts only) Numeric

Heatmap Charts

Field Description Typical Data Type
X-Axis Horizontal dimension (e.g., time, hour) String, Date
Y-Axis Vertical dimension (e.g., day, category) String, Date
Value Intensity value represented by color Numeric

Geographic Charts

Field Description Typical Data Type
Latitude Latitude coordinate Numeric
Longitude Longitude coordinate Numeric
Geo Region Map region (world, usa, china, etc.) Selection
Value Value for point size or color intensity (optional) Numeric

Candlestick Charts

Field Description Typical Data Type
Time Time period for each candlestick Date
Open Opening value Numeric
High Highest value Numeric
Low Lowest value Numeric
Close Closing value Numeric

Sankey Diagrams

Field Description Typical Data Type
Source Starting point of flow String
Target Ending point of flow String
Value Flow quantity or weight Numeric

Manual Field Mapping

To manually configure field mappings, use the dropdowns in the data mapper panel. Each dropdown shows the available fields from your data. As you change mappings, the chart preview updates in real-time to reflect your selections.

Chart Customization

The configuration panel on the right side provides extensive options to customize your chart's appearance and behavior.

Video CHBU07 Customizing Chart Appearance - Step-by-step demonstration: (1) Open the configuration panel on the right side of the Chart Builder, (2) Enter a descriptive chart title in the "Chart Title" field for workspace organization, (3) Add an optional description to document what the chart shows, (4) Set a folder path (e.g., "reports/sales" or "analytics/metrics") to organize the chart in your workspace, (5) Customize display labels including chart title for visualization, subtitle, X-axis label, Y-axis label, and legend label, (6) Adjust data limit to control how many documents are fetched, (7) Watch the live preview update as you make customization changes, (8) Toggle between different sections to explore all available customization options.
Configuration panel showing basic settings and display labels sections

Basic Settings

Setting Description Default
Chart Title Name of the chart for workspace organization Untitled Chart
Description Optional description of what the chart shows Empty
Folder Path Organization path (e.g., "reports/sales" or "analytics/metrics") Root folder
Data Limit Maximum number of documents to fetch for the chart 1000

Display Labels

Customize how your chart appears by adding custom labels and titles. These labels are displayed in the rendered chart visualization.

Label Description Default
Chart Title Main title displayed at the top of the chart None
Subtitle Additional context below the main title None
X-Axis Label Label for horizontal axis Field name
Y-Axis Label Label for vertical axis Field name
Legend Label Custom label for chart legend None

Tip: Leave axis labels empty to automatically use the field names from your data. Add custom labels when you want more descriptive or user-friendly text in your charts.

Editing the Data Source

Charts are powered by either a query or an aggregation pipeline. You can modify the underlying data source directly from the Chart Builder without leaving the interface.

Edit Query or Edit Aggregation button in the preview panel toolbar

Editing a Query-Based Chart

Click the "Edit Query" button to open a Collection Activity where you can:

  • Modify the filter query to change which documents are included
  • Adjust sort order to reorganize results
  • Update projection to include or exclude specific fields
  • Change limit and skip values to control result size

When you're done editing, the Chart Builder automatically refreshes with the updated data.

Editing an Aggregation-Based Chart

Click the "Edit Aggregation" button to open an Aggregation Activity where you can:

  • Add, remove, or reorder pipeline stages
  • Modify stage configurations to transform data differently
  • Use the preview panel to verify each stage's output
  • Build complex data transformations with grouping, calculations, and joins

Changes to the aggregation pipeline immediately affect the chart's data source.

Saving and Managing Charts

Once you've created and configured your chart, save it to your workspace for future access and reuse. Saved charts can be organized, edited, and integrated into dashboards.

Saving a Chart

  1. Ensure you've provided a meaningful chart title in the configuration panel
  2. Optionally set a folder path to organize the chart (e.g., "sales/monthly" or "analytics")
  3. Click the "Save Chart" button in the bottom-right corner
  4. The chart is now saved and accessible from the Charts workspace

Updating an Existing Chart

When you open a saved chart and make changes:

  • The chart automatically enters edit mode
  • Modify any settings, mappings, or the data source
  • Click "Save Chart" to update the existing chart with your changes
  • All references to this chart (in dashboards or links) will reflect the updates

Chart Organization

Use folder paths to organize charts hierarchically:

  • Use forward slashes to create nested folders: reports/sales/monthly
  • Leave the folder field empty to save charts at the root level
  • Use consistent naming conventions across your team for easy discovery
  • Consider organizing by: department, project, data source, or chart type

Actions and Workflow

  • Auto Detect Fields - Automatically map fields to chart dimensions based on data types and chart requirements. Click the "Auto Detect" button in the data mapper panel to let the system intelligently suggest field mappings. This is the fastest way to get started with a new chart.
  • Edit Query/Aggregation - Modify the underlying data source without leaving the Chart Builder. Click "Edit Query" or "Edit Aggregation" in the preview panel to open the appropriate editor, make your changes, and see the chart update automatically.
  • Toggle Panels - Collapse the left or right panels to maximize chart preview space. Use the blue toggle button on the left panel and the purple toggle button on the right panel. This is helpful when working with complex charts that need more screen space.
  • Switch Chart Types - Experiment with different visualizations by changing the chart type. Click the chart type dropdown in the left panel and select a new type. Click outside the dropdown to close it without making a selection. Your field mappings will be preserved where applicable, making it easy to find the best visualization for your data.
  • Save Chart - Save your configured chart to the workspace for future access. Ensure you've set a meaningful title and optional folder path, then click "Save Chart" in the bottom-right corner. The chart will be available in the Charts workspace for viewing and editing.
  • Cancel - Close the Chart Builder without saving changes. Click "Cancel" in the bottom-right corner to exit. Any unsaved modifications will be lost, so ensure you've saved your work before canceling if you want to keep your changes.

Advanced Features

Geographic Map Regions

When using geographic charts (Geo Map, Geo Scatter, Geo Heatmap), you can select different map regions to focus your visualization:

  • World - Global map with all countries
  • USA - United States with state boundaries
  • China - China with province boundaries
  • Japan - Japan with prefecture boundaries
  • Canada - Canada with province/territory boundaries
  • UK - United Kingdom with regional boundaries
  • Germany - Germany with state boundaries
  • France - France with regional boundaries
  • India - India with state boundaries
  • Australia - Australia with state/territory boundaries
  • Europe - European continent view
  • Asia - Asian continent view

Real-Time Preview

The Chart Builder provides instant visual feedback:

  • Charts update automatically as you change field mappings
  • Label changes are reflected immediately in the preview
  • Switching chart types preserves your data and shows the new visualization instantly
  • Data limit changes trigger automatic re-query after a short delay

Data Limit Management

The data limit setting controls how many documents are fetched for visualization:

  • Default limit is 1000 documents for balanced performance and data completeness
  • Reduce the limit for faster queries with large datasets
  • Increase the limit (up to 10,000) when you need comprehensive data coverage
  • Changes to the limit automatically re-execute the query after a brief debounce period

Pro Tips

  • Start with Auto Detect - Use the "Auto Detect" button first to get intelligent field mappings, then manually refine them. This saves time and helps you understand which fields work best for each chart type.
  • Prepare Data with Aggregation - For complex charts, use aggregation pipelines to pre-process data before charting. Group, calculate, and transform your data first, then create simple charts from the aggregated results.
  • Use Folders for Organization - Establish a folder structure early (e.g., "dashboards/executive", "reports/monthly", "analytics/user"). This makes charts easier to find and maintain as your library grows.
  • Experiment with Chart Types - Don't settle on the first chart type. Try switching between Bar, Line, Area, and other types to find the clearest way to communicate your data story. Different types reveal different insights.
  • Add Descriptive Labels - While field names work as defaults, adding custom titles, subtitles, and axis labels makes charts more professional and easier to understand for stakeholders who may not know your data schema.
  • Optimize Data Limits - For time-series or trending data, consider reducing the data limit and using sort orders to show "Top N" or "Most Recent" data. This improves performance while keeping charts focused and readable.
  • Leverage Geographic Charts - If your data includes location information (coordinates, country/state names, regions), geographic visualizations can reveal spatial patterns that are invisible in traditional charts.
  • Use Heatmaps for Patterns - Heatmaps are excellent for finding patterns in two-dimensional categorical data, like "hour of day vs. day of week" or "product vs. region". The color intensity makes patterns jump out visually.
  • Collection Activity - Query collections and create charts from filtered result sets. Use the Query Builder to construct complex filters, then visualize the results with one click.
  • Aggregation Pipeline Builder - Build powerful data transformations with MongoDB's aggregation framework. Create charts from grouped, calculated, and transformed data for advanced analytics.
  • Chart Library - Access, organize, and manage all your saved charts. View charts in list or folder view, search by name or description, and open charts for editing or viewing.
  • Export Data - Export chart data in various formats (JSON, CSV, Excel) for use in external tools or reports. Combine charting with data export for comprehensive analysis workflows.

Ready to try VisuaLeaf?

Download and start managing your MongoDB databases with ease.

Download Free Trial