Add support for Y axis labels

Change-Id: I42ff3fa12fbb792b2544e0697c3ab87b0768e82d
This commit is contained in:
James E. Blair 2016-01-06 11:14:04 -08:00
parent fd09f80b1e
commit ff88ef29e2
3 changed files with 52 additions and 0 deletions

View File

@ -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)

View 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"
}
}
}

View 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