NeoDash: multiline chart doesn't show colors

Viewed 53

my line chart visualization it's about 3 outputs it gives me that : enter image description here while I expected each "line" with different color. the problem persists even though I tried to modify parameters: enter image description here here is my code:

call gds.pageRank.stream("Morocco19")
YIELD nodeId as names, score
with gds.util.asNode(names).city AS city,score AS sm19
ORDER BY sm19 DESC, city asc
call gds.pageRank.stream("FR19")
YIELD nodeId as names, score
with gds.util.asNode(names).city AS city,score AS sf19,sm19
ORDER BY sf19 DESC, city asc
call gds.pageRank.stream("spaine19")
YIELD nodeId as names, score
with gds.util.asNode(names).city AS city,score AS ss19,sf19,sm19
ORDER BY ss19 DESC, city asc
call gds.pageRank.stream("Morocco20")
YIELD nodeId as names, score
with gds.util.asNode(names).city AS city,score AS sm20,ss19,sf19,sm19
ORDER BY sm20 DESC, city asc
call gds.pageRank.stream("FR20")
YIELD nodeId as names, score
with gds.util.asNode(names).city AS city,score AS sf20,sm20,ss19,sf19,sm19
ORDER BY sf20 DESC, city asc
call gds.pageRank.stream("spaine20")
YIELD nodeId as names, score
with gds.util.asNode(names).city AS city,score AS ss20,sf20,sm20,ss19,sf19,sm19
ORDER BY ss20 DESC, city asc
UNWIND [
{country: "morocco",year: 2019, TCF:sm19},
{country: "morocco",year: 2020, TCF:sm20},
{country:"spaine",year: 2019, TCF:ss19},
{country:"spaine",year: 2020, TCF:ss20},
{country:"france",year: 2020, TCF:sf19},
{country:"france",year: 2020, TCF:sf20}
] as row
WITH row.year as year,row.country as country, row.TCF as TCF
ORDER BY country ASC 
WITH year,collect([country, TCF]) as TCF_year_pairs
RETURN year,TCF_year_pairs[0][1] as value_M,TCF_year_pairs[1][1] as value_S,TCF_year_pairs[2][1] as value_F

I'm sorry it's very long to read. thank you in advance for any help or suggestions.

1 Answers

Thanks for reaching out about NeoDash! The issue here is related to how rule-based styling works for line charts, which is (admittedly) a little confusing.

Rules are evaluated for every single point in the line, and if the rule is valid for one entry, the color change is applied. For example, if a threshold is reached (one value on the line is greater than 100) the entire line might be turned red. This also means that if no rules are met, the color reverts to a fallback (black in this case).

For your use-case, I think you can get away with removing all the rules. When no rules are present, the default color scheme kicks in and each line will get a unique color.

I will take some time in the future to extend the docs (https://neo4j.com/labs/neodash/2.1/user-guide/reports/line-chart/) on this topic and make it a bit clearer. Hope this helps for now.

Best regards, Niels

Related