Commit fa2a7db6 by Torkel Ödegaard

ux: create annotations

parent 03ef1fd7
...@@ -57,7 +57,7 @@ export class EventManager { ...@@ -57,7 +57,7 @@ export class EventManager {
this.panelCtrl.render(); this.panelCtrl.render();
} }
addPlotEvents(annotations) { addFlotEvents(annotations, flotOptions) {
if (this.event || annotations.length === 0) { if (this.event || annotations.length === 0) {
return; return;
} }
...@@ -108,7 +108,7 @@ export class EventManager { ...@@ -108,7 +108,7 @@ export class EventManager {
} }
} }
options.events = { flotOptions.events = {
levels: _.keys(types).length + 1, levels: _.keys(types).length + 1,
data: annotations, data: annotations,
types: types, types: types,
......
...@@ -330,8 +330,8 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) { ...@@ -330,8 +330,8 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
} }
} }
thresholdManager.addPlotOptions(options, panel); thresholdManager.addFlotOptions(options, panel);
eventManager.addPlotEvents(annotations, options); eventManager.addFlotEvents(annotations, options);
configureAxisOptions(data, options); configureAxisOptions(data, options);
sortedSeries = _.sortBy(data, function(series) { return series.zindex; }); sortedSeries = _.sortBy(data, function(series) { return series.zindex; });
......
...@@ -21,7 +21,7 @@ describe('ThresholdManager', function() { ...@@ -21,7 +21,7 @@ describe('ThresholdManager', function() {
ctx.setup = function(thresholds) { ctx.setup = function(thresholds) {
ctx.panel.thresholds = thresholds; ctx.panel.thresholds = thresholds;
var manager = new ThresholdManager(ctx.panelCtrl); var manager = new ThresholdManager(ctx.panelCtrl);
manager.addPlotOptions(ctx.options, ctx.panel); manager.addFlotOptions(ctx.options, ctx.panel);
}; };
func(ctx); func(ctx);
......
...@@ -158,7 +158,7 @@ export class ThresholdManager { ...@@ -158,7 +158,7 @@ export class ThresholdManager {
this.needsCleanup = true; this.needsCleanup = true;
} }
addPlotOptions(options, panel) { addFlotOptions(options, panel) {
if (!panel.thresholds || panel.thresholds.length === 0) { if (!panel.thresholds || panel.thresholds.length === 0) {
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment