Add support for Y axis labels
Change-Id: I42ff3fa12fbb792b2544e0697c3ab87b0768e82d
This commit is contained in:
parent
fd09f80b1e
commit
ff88ef29e2
@ -33,6 +33,8 @@ class Graph(Base):
|
||||
v.Required('targets', default=[]): v.All(list),
|
||||
v.Required('x-axis', default=True): v.All(bool),
|
||||
v.Required('y-axis', default=True): v.All(bool),
|
||||
v.Optional('leftYAxisLabel'): v.All(str, v.Length(min=1)),
|
||||
v.Optional('rightYAxisLabel'): v.All(str, v.Length(min=1)),
|
||||
}
|
||||
graph.update(self.base)
|
||||
return v.Schema(graph)
|
||||
|
40
tests/schema/fixtures/dashboard-0009.json
Normal file
40
tests/schema/fixtures/dashboard-0009.json
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"dashboard": {
|
||||
"new-dashboard": {
|
||||
"rows": [
|
||||
{
|
||||
"collapse": false,
|
||||
"editable": true,
|
||||
"height": "250px",
|
||||
"panels": [
|
||||
{
|
||||
"bars": false,
|
||||
"editable": true,
|
||||
"error": false,
|
||||
"fill": 1,
|
||||
"leftYAxisLabel": "left label",
|
||||
"lines": true,
|
||||
"linewidth": 2,
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"rightYAxisLabel": "right label",
|
||||
"span": 12,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [],
|
||||
"title": "no title (click here)",
|
||||
"type": "graph",
|
||||
"x-axis": true,
|
||||
"y-axis": true
|
||||
}
|
||||
],
|
||||
"showTitle": false,
|
||||
"title": "New row"
|
||||
}
|
||||
],
|
||||
"timezone": "utc",
|
||||
"title": "New dashboard"
|
||||
}
|
||||
}
|
||||
}
|
10
tests/schema/fixtures/dashboard-0009.yaml
Normal file
10
tests/schema/fixtures/dashboard-0009.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
dashboard:
|
||||
title: New dashboard
|
||||
rows:
|
||||
- title: New row
|
||||
height: 250px
|
||||
panels:
|
||||
- title: no title (click here)
|
||||
type: graph
|
||||
leftYAxisLabel: left label
|
||||
rightYAxisLabel: right label
|
Loading…
x
Reference in New Issue
Block a user