Create dashboards with Cypher
To create a dashboard from scratch, you need an instance and data. The examples on this page use the Northwind sample dataset which you can also use.
-
Select Create from scratch.
-
The UI takes you directly to the new dashboard. To change the title, select the title text and edit it, then confirm.
-
Your dashboard has a single page titled "Main page". To change the name, hover it and then use the more menu […] and Edit page name.
-
Use Add card to create cards which represent visualizations.
Add a card with a bar chart
Create a bar chart which displays the number of orders per customer.
In the dashboard page tab:
-
Use Add card at the bottom right of the page.
-
In the new card, select Bar chart from the chart type drop-down at the top right.
-
Edit the Cypher query of the card and paste the following Cypher query to the input field, then Save:
MATCH (c:Customer)-[:PURCHASED]->(o:Order) RETURN c.contactName AS Customer, count(o) AS Orders ORDER BY Orders DESC LIMIT 10
Your bar chart should look like this:
Add a card with a line chart
Create a line chart which displays the number of product categories by order dates.
In the dashboard page tab:
-
Use Add card at the bottom right of the page.
-
In the new card, select Line chart from the chart type drop-down at the top right.
-
Edit the Cypher query of the card and paste the following Cypher query to the input field, then Save:
MATCH (o:Order)-[ORDERS]->(p:Product)-[:PART_OF]->(c:Category) WITH o.orderDate AS orderDate, count(DISTINCT c) AS categoryCount RETURN orderDate, categoryCount ORDER BY orderDate LIMIT 20
Your line chart should look like this:
Alternatively, use natural language to create the query for your bar chart.
Next steps
See Managing dashboards for more dashboard options.
See Visualizations to learn about the different charts and visualizations of Neo4j dashboards.