diff --git a/grafana_dashboards/schema/panel/graph.py b/grafana_dashboards/schema/panel/graph.py index 20b1dab..4d18bb4 100644 --- a/grafana_dashboards/schema/panel/graph.py +++ b/grafana_dashboards/schema/panel/graph.py @@ -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) diff --git a/tests/schema/fixtures/dashboard-0009.json b/tests/schema/fixtures/dashboard-0009.json new file mode 100644 index 0000000..b52d3e7 --- /dev/null +++ b/tests/schema/fixtures/dashboard-0009.json @@ -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" + } + } +} diff --git a/tests/schema/fixtures/dashboard-0009.yaml b/tests/schema/fixtures/dashboard-0009.yaml new file mode 100644 index 0000000..1f118c5 --- /dev/null +++ b/tests/schema/fixtures/dashboard-0009.yaml @@ -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 \ No newline at end of file