5
votes

In neo4j, how can I display multiple properties on graph? For example if I need to display a person's name and birth_year.

When I run this query MATCH (p:person) RETURN p.person_id, p.birth_year LIMIT 25 it shows data in tabular format in the neo4j browser. If I click on graph it says "No graph view available. You have to RETURN nodes, relationships or paths to see a graph visualization."

Any suggestions?

1

1 Answers

5
votes

The Neo4j 2.2 browser shows multiple properties when you click on a node, in the bottom panel. That does mean you need to return nodes i.e. MATCH (p:person) return p limit 25 to be able to use the graph visualization.

EDIT: You can edit the Graph Style Sheet to contain something like this:

node.person {
  color: #68BDF6;
  border-color: #5CA8DB;
  text-color-internal: #FFFFFF;
  caption: '{person_id},{birth_year}';
}

but then you'd have to do this for every kind of customization you want.