Merge "Add yaxes format for newer versions of Grafana"
This commit is contained in:
commit
1f7fcdd161
|
@ -81,8 +81,17 @@ class Graph(Base):
|
||||||
u'pressurehg',
|
u'pressurehg',
|
||||||
u'pressurepsi',
|
u'pressurepsi',
|
||||||
)
|
)
|
||||||
|
yaxes_format = [
|
||||||
y_formats = [y_format]
|
{
|
||||||
|
v.Optional('decimals'): int,
|
||||||
|
v.Optional('format', default='short'): y_format,
|
||||||
|
v.Optional('label', default=''): v.All(str),
|
||||||
|
v.Optional('logBase', default=1): v.All(int, v.Range(min=1)),
|
||||||
|
v.Optional('max'): v.All(int, v.Range(min=1)),
|
||||||
|
v.Optional('min'): v.All(int, v.Range(min=1)),
|
||||||
|
v.Optional('show', default=True): v.All(bool),
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
legend = {
|
legend = {
|
||||||
v.Optional('alignAsTable', default=False): v.All(bool),
|
v.Optional('alignAsTable', default=False): v.All(bool),
|
||||||
|
@ -149,7 +158,8 @@ class Graph(Base):
|
||||||
v.Optional('tooltip'): v.All(tooltip),
|
v.Optional('tooltip'): v.All(tooltip),
|
||||||
v.Required('x-axis', default=True): v.All(bool),
|
v.Required('x-axis', default=True): v.All(bool),
|
||||||
v.Required('y-axis', default=True): v.All(bool),
|
v.Required('y-axis', default=True): v.All(bool),
|
||||||
v.Optional('y_formats'): v.All(y_formats, v.Length(min=2, max=2)),
|
v.Optional('y_formats'): v.All([y_format], v.Length(min=2, max=2)),
|
||||||
|
v.Optional('yaxes'): v.All(yaxes_format, v.Length(min=2, max=2)),
|
||||||
}
|
}
|
||||||
graph.update(self.base)
|
graph.update(self.base)
|
||||||
return v.Schema(graph)
|
return v.Schema(graph)
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
"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,
|
||||||
|
"yaxes": [
|
||||||
|
{
|
||||||
|
"format": "hertz",
|
||||||
|
"label": "",
|
||||||
|
"logBase": 1,
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"format": "\u00b5s",
|
||||||
|
"label": "",
|
||||||
|
"logBase": 1,
|
||||||
|
"show": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"showTitle": false,
|
||||||
|
"title": "New row"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"templating": {
|
||||||
|
"enabled": false,
|
||||||
|
"list": []
|
||||||
|
},
|
||||||
|
"timezone": "utc",
|
||||||
|
"title": "New dashboard"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
dashboard:
|
||||||
|
title: New dashboard
|
||||||
|
rows:
|
||||||
|
- title: New row
|
||||||
|
height: 250px
|
||||||
|
panels:
|
||||||
|
- title: no title (click here)
|
||||||
|
type: graph
|
||||||
|
leftYAxisLabel: left label
|
||||||
|
rightYAxisLabel: right label
|
||||||
|
yaxes:
|
||||||
|
- format: hertz
|
||||||
|
- format: µs
|
Loading…
Reference in New Issue