Creating different visualizations

So far in this course, you have learned how to organize your dashboard structure.

In this lesson, you will learn how to:

  • Compare different ways to visualize aggregated metrics

  • Visualize your aggregated data using Cypher queries

  • Choose the appropriate visualization type for your data

Visualizing the data

There are multiple visualization types available in Neo4j Dashboards, each suited for different data representation needs:

  • Graph - Shows relationships between nodes

  • Table - Displays detailed data in a structured format

  • Line Chart - Tracks trends over time

  • Bar Chart - Compares quantities across categories

  • Pie Chart - Displays proportions of a whole

  • Single Value - Highlights a key metric

  • Text - Adds descriptive information or context

From the card editor, select the dropdown menu under Visualization type to choose the most appropriate visualization for your data:

Change card type dialog

The Dashboard tool supports the following visualization types:

  • Graph - Shows relationships between nodes.

  • Table - Displays detailed data in a structured format.

  • Line Chart - Tracks trends over time.

  • Bar Chart - Compares quantities across categories.

  • Pie Chart - Displays proportions of a whole.

  • Single Value - Highlights a key metric.

  • Text - Adds descriptive information or context.

Graph card

The Graph visualization type is ideal for displaying relationships between nodes in your graph database. It provides an interactive way to explore how different entities are connected.

Use the AI assistant to generate a graph card based on a natural language prompt, or write a Cypher query to fetch specific nodes and relationships.

For example, create a graph card to visualize the relationships between actors and movies:

Graph card example

Table card

The Table is best for detailed data representation. It allows you to display data in a structured format, making it easy to read and analyze.

Create a table card to show a list of movies along with their genres and release years:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (u:User)-[r:RATED]->(m:Movie)
RETURN m.title AS movie, u.name AS user, r.rating AS rating
ORDER BY r.rating DESC
LIMIT 10
Table card example

Line chart card

The Line Chart is useful for showing trends over time. It allows you to visualize data points connected by lines, making it easy to identify patterns and fluctuations.

Create a line chart card to visualize the average ratings of movies over time:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (m:Movie)
WITH m, toInteger(m.year / 10) * 10 AS decade
RETURN decade, count(m) AS movieCount
ORDER BY decade

After running this query, select Line Chart from the visualization type dropdown to display the results.

You should obtain something similar to this:

Line Chart card example

Bar Chart card

The Bar Chart visualization type is suitable for comparing quantities across categories. It provides a clear visual representation of data, making it easy to identify trends and patterns.

Create a bar chart card to visualize the ratings distribution per location:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (p:Person)-[:DIRECTED]->(m:Movie)
RETURN p.bornIn AS country, count(m) AS movieCount
ORDER BY movieCount DESC
Bar Chart card example

Challenge: Create a bar chart card to visualize the number of movies directed by each person.

Pie Chart card

The Pie Chart visualization type is great for displaying proportions of a whole. It allows you to visualize how different categories contribute to the total.

Create a pie chart card to visualize the distribution of directors average movie ratings:

Ask the GenAI assistant to create a pie chart card using the following prompt: "Create a pie chart showing directors with the highest average movie ratings." or run the following Cypher query in the card editor to get the results:

cypher
/* Which directors have the highest average movie ratings? */

MATCH (d:Director)-[r:DIRECTED]->(m:Movie)<-[r2:RATED]-(u:User)
WITH d, avg(r2.rating) AS averageRating
ORDER BY averageRating DESC
RETURN d.name AS directorName, averageRating
LIMIT 10

You should obtain something similar to this:

Single Value card

The Single Value visualization type is perfect for highlighting a key metric. It allows you to display a single data point prominently, making it easy to focus on important information.

Create a single value card to show the total number of movies in the instance:

Execute the following Cypher query in the card editor to get the results:

cypher
MATCH (n)
RETURN COUNT(n) as Total

You should obtain something similar to this:

Single Value card example

If you have obtained a different value, don’t worry! The data in your instance may vary based on other activities you have performed.

Text card

Adding text is a practical way to add context to your dashboard and help stakeholders understand the data being presented, as well as generating a local overview of all dashboards in one place by inserting the images of each dashboard.

For example, create a text card to describe the purpose of your favourite movie, in this example, The Matrix:

Copy and paste the following markdown text into the card editor:

markdown
# The Matrix (1999)

## Overview
A computer hacker learns from mysterious rebels about the true nature of his reality and his role in the war against its controllers.

## Details

**Director:** The Wachowskis
**Released:** March 31, 1999
**Runtime:** 136 minutes
**Rating:** R

### Genre
- Science Fiction
- Action
- Cyberpunk

### Cast
- **Keanu Reeves** as Neo
- **Laurence Fishburne** as Morpheus
- **Carrie-Anne Moss** as Trinity
- **Hugo Weaving** as Agent Smith

## Box Office & Reception

**Budget:** $63 million
**Box Office:** $467.2 million worldwide
**IMDb Rating:** 8.7/10
**Rotten Tomatoes:** 88% (Critics), 85% (Audience)

## Awards
- 🏆 4 Academy Awards (Visual Effects, Sound, Film Editing, Sound Effects Editing)
- 🏆 2 BAFTA Awards

## Key Relationships in Graph
```
(The Matrix)-[:DIRECTED_BY]->(The Wachowskis)
(Keanu Reeves)-[:ACTED_IN {role: "Neo"}]->(The Matrix)
(The Matrix)-[:GENRE]->(Science Fiction)
```

## Tagline
*"Free your mind."*

---

**Last Updated:** 2025-11-11
**Data Source:** Neo4j Movies Database

In the card editor, the markdown text will be rendered as follows:

text card example part 1

In the screenshot above, the first part of the rendered markdown text is shown. Scrolling down reveals the rest of the content, and the menu on the bottom left allows you to edit, insert, or view the raw markdown text.

On the dashboard page, the text card will appear as a brief overview of the movie:

text card example part 2

Challenge: Use your creativity to add more text cards to your dashboard, providing context and insights about the data being visualized.

Visualising aggregated data

You have seen multiple ways to visualize aggregated data using different card types in Neo4j Dashboards.

When working with aggregated data, it’s important to choose the right visualization type that effectively communicates the insights you want to convey. Consider the following factors when selecting a card type:

  1. Data Granularity: Understand the level of detail in your data. Some visualizations work better with high-level aggregates, while others are more suited for detailed breakdowns.

  2. Audience: Consider who will be viewing the dashboard. Tailor your visualizations to the needs and preferences of your audience.

  3. Context: Provide context for your visualizations. Use text cards to explain the significance of the data and highlight key insights.

  4. Interactivity: Leverage interactive features, such as filters and drill-downs, to allow users to explore the data further.

Hands on challenge: Create a new dashboard for the marketing team to visualize movie insights. Build cards that show:

  • Total number of movies per genre (helps identify content gaps)

  • Average movie ratings per decade (shows trends in content quality)

  • Top 5 directors with the highest average movie ratings (identifies successful content creators)

Use the appropriate card types to represent each metric effectively, and add text cards to provide context and explanations for the visualizations. These insights will help the marketing team make data-driven decisions about content and acquisition.

Share your dashboard with your peers and discuss the choices you made for each visualization, or post it on our community forum for feedback Neo4j Community.

If you are new to data aggregation, these metrics will help you get started.

Run the following Cypher queries to get the aggregated data for each metric, in a separate card each time. Feel free to choose the visualization type that best represents the data.

  • Count metrics: Total number of nodes or relationships that meet specific criteria.

cypher
MATCH (m:Movie)
RETURN count(m) AS total_movies
  • Average metrics: The average value of a specific property across a set of nodes or relationships.

cypher
MATCH (m:Movie)-[:IN_GENRE]->(g:Genre)
RETURN g.name AS genre,
    avg(toFloat(m.rating)) AS average_rating,
    count(m) AS total_movies
ORDER BY average_rating DESC
  • Distribution metrics: The spread of values for a specific property across nodes or relationships.

cypher
MATCH (m:Movie)
WHERE m.rating IS NOT NULL
RETURN m.rating AS rating,
    count(*) AS count
ORDER BY rating DESC

Reusing queries for recommendation insights

Reuse the Cypher queries provided in this lesson to create multiple cards with different visualization types for your movie recommendation dashboards. For example, create both a bar chart and a pie chart using the same query to visualize the distribution of movie ratings from different perspectives. Also, feel free to modify the queries to explore different aspects of your recommendation data. Cypher functions like count(), avg(), and sum() can be very useful for aggregating data about movies, actors, and user preferences.

Security and access control

Security applies to dashboards based on the access control permissions assigned to users. If a user’s role does not allow viewing certain data, they will not see that data in the dashboard. Users will only see data they have permission to access based on their role.

Check your understanding

Visualizing aggregated metrics for recommendations

You want to understand which movie genres are most popular in your recommendation system. Instead of looking at individual movies, you want to see the total count of movies per genre. What is the benefit of visualizing this aggregated data?

  • ❏ To see every individual movie record in detail

  • ✓ To identify trends and patterns in genre popularity that help with content recommendations

  • ❏ To export raw movie data for external analysis

  • ❏ To generate random visualizations for testing

Hint

Aggregated data (like counts, averages, sums) summarizes information to reveal patterns and trends. For recommendation systems, this helps identify which genres are popular, which actors drive engagement, and how user preferences change over time—insights that aren’t visible when looking at individual records.

Solution

To identify trends and patterns in genre popularity that help with content recommendations.

Visualizing aggregated data (like total movies per genre, average ratings per decade, or top-rated directors) helps you identify trends and patterns that aren’t apparent from individual records. For your movie recommendation system, these insights help stakeholders make data-driven decisions about which content to recommend, which genres to focus on, and how user preferences evolve over time.

Summary

In this lesson, you learned how to visualize aggregated metrics from your movie recommendation data using different visualization types. You created dashboards that show ratings distributions, genre popularity, and actor collaboration patterns—insights that help stakeholders make data-driven decisions about content recommendations.

In the next lesson, you will learn how to:

  • Share your movie recommendation dashboards with stakeholders

  • Enable collaboration and data-driven decision-making across your organization

Chatbot

How can I help you today?