Always return colors for single stat graphs

Addresses a change that requires single stat graphs to have an array of
colors, specifically  in the case of canned dashboards. An empty array
is acceptable but an undefined value will break the page.

Closes #2862
Closes #2841
pull/10616/head
Brandon Farmer 2018-03-12 20:14:04 -07:00
parent b2e8612c64
commit 620aa7a518
3 changed files with 13 additions and 9 deletions

View File

@ -56,6 +56,7 @@
]
}
],
"colors": [],
"type": "single-stat"
},
{
@ -73,6 +74,7 @@
]
}
],
"colors": [],
"type": "single-stat"
},
{

View File

@ -117,6 +117,7 @@
"h": 4,
"i": "0fa47984-825b-46f1-9ca5-0366e3220008",
"name": "Mesos Master Uptime",
"colors": [],
"type": "single-stat",
"queries": [
{

View File

@ -581,6 +581,7 @@ type Cell struct {
Queries []Query `json:"queries"`
Axes map[string]Axis `json:"axes"`
Type string `json:"type"`
CellColors []CellColor `json:"colors"`
}
// Layout is a collection of Cells for visualization