PIE Chart (Donut) - No data points error

I am trying to use a Pie Chart (Donut style format) but keep getting a No data points error. Is there a step by step guide on how to use the chart? The install instructions did not go into this level of detail. The query itself is fine but i suspect it’s my way of using it with the chart that is the issue.

The JSON is:
{
“aliasColors”: {},
“cacheTimeout”: null,
“combine”: {
“label”: “Others”,
“threshold”: 0
},
“datasource”: “testDB”,
“fontSize”: “80%”,
“format”: “none”,
“gridPos”: {
“h”: 15,
“w”: 16,
“x”: 5,
“y”: 10
},
“id”: 8,
“interval”: null,
“legend”: {
“show”: true,
“values”: true
},
“legendType”: “Under graph”,
“links”: [],
“maxDataPoints”: 3,
“nullPointMode”: “connected”,
“pieType”: “donut”,
“strokeWidth”: 1,
“targets”: [
{
“alias”: “”,
“format”: “table”,
“rawSql”: “SELECT\n item as value,\n weight as metric\nFROM holdings\nWHERE weight > 0.008\nORDER BY item ASC”,
“refId”: “A”,
“hide”: false
}
],
“title”: “Current Holdings”,
“type”: “grafana-piechart-panel”,
“valueName”: “current”
}

what version of Grafana are you using? I pushed a new version of pie chart panel today, try to update it.

No luck with the new version either.

I am running Grafana v5.0.0-beta1 (commit: 3e2da1f)

Anyone else have any other suggestions that I could try? Or is there a working example that I could look at? I really want to get this chart working.

Anyone? Still struggling to get anything to show up properly for this. Would love to see a working example/tutorial

Think you need to select a time column in your select statement as well? Please try that and let me know the result.

Marcus

For a pie chart? I don’t have a time column like most pie charts? For example:

Apple: 4
Orange: 10
Pear: 2
Watermelon: 4

Drawn as a pie chart should be easy, how would you factor in a time column to that dataset?

This is Grafana, a tool for visualizing timeseries data. I just tried to use MySql to render a piechart using a similar query like you (without time column) and I get “Found no column named time or time_sec” even if I select format as timeseries or format as table.

Workaround is to add current date to the query like

SELECT 
  now() as time_sec,
  item as value, 
  weight as metric
FROM 
  holdings
WHERE 
  weight > 0.008
ORDER BY i
  tem ASC

Marcus

2 Likes

I have seen same trouble on PostgreSQL, too. It had better to write the document on github.

1 Like