I would like to create a Node Graph based on two SQL-Tables: I already created the SQL-tables and connected the database to Grafana. One table includes the data for the Nodes and the other table the data of the Edges, as described within the Node Graph documentation:
I have problems to find the correct SQL-query in order to illustrate the Node graph.
With the following query, I can illustrate the data at least in a Table format in Grafana.
SELECT TOP (1000) [id-N0000] as id
,[Title-Location] as title
,[subTitle-BatchNumber] as subTitle
,[secondaryStat-Sieving grad] as secondaryStat
,[arc__] as arc__1
,[detail__] as arc__2
SELECT TOP (1000) [id-E0000] as id
,[source-N0000] as source
,[target-N0000] as target
,[mainStrat-PowderMass] as mainStat
,[secondaryStat] as secondaryStat
,[detail__*] as detail__1
However I dont know, how to combine the two queries and how to say to Grafana, which data parameter to use for the Nodes and which ones to use for the edges.
Create two queries as you have and use them. Make sure your SQL server returns correct aliases (for example redshift AS subTitle returns subtitle column; node graph panel is case sensitive for those column names). Recent Grafana version has also a problem:
Node Graph is still beta and it is used mainly for tracing visualizations, so I would say there can be still more problems with SQL datasources.
thank you for your feedback. I have inserted the queries in Grafana as you described. I see the node data table in the table view. The lower and upper case is also consistent with the documentation. In the graph view I see “No Data” unfortunately. Do you notice an error?