mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux: create annotations
This commit is contained in:
parent
03ef1fd758
commit
fa2a7db657
@ -57,7 +57,7 @@ export class EventManager {
|
||||
this.panelCtrl.render();
|
||||
}
|
||||
|
||||
addPlotEvents(annotations) {
|
||||
addFlotEvents(annotations, flotOptions) {
|
||||
if (this.event || annotations.length === 0) {
|
||||
return;
|
||||
}
|
||||
@ -108,7 +108,7 @@ export class EventManager {
|
||||
}
|
||||
}
|
||||
|
||||
options.events = {
|
||||
flotOptions.events = {
|
||||
levels: _.keys(types).length + 1,
|
||||
data: annotations,
|
||||
types: types,
|
||||
|
@ -330,8 +330,8 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
|
||||
}
|
||||
}
|
||||
|
||||
thresholdManager.addPlotOptions(options, panel);
|
||||
eventManager.addPlotEvents(annotations, options);
|
||||
thresholdManager.addFlotOptions(options, panel);
|
||||
eventManager.addFlotEvents(annotations, options);
|
||||
configureAxisOptions(data, options);
|
||||
|
||||
sortedSeries = _.sortBy(data, function(series) { return series.zindex; });
|
||||
|
@ -21,7 +21,7 @@ describe('ThresholdManager', function() {
|
||||
ctx.setup = function(thresholds) {
|
||||
ctx.panel.thresholds = thresholds;
|
||||
var manager = new ThresholdManager(ctx.panelCtrl);
|
||||
manager.addPlotOptions(ctx.options, ctx.panel);
|
||||
manager.addFlotOptions(ctx.options, ctx.panel);
|
||||
};
|
||||
|
||||
func(ctx);
|
||||
|
@ -158,7 +158,7 @@ export class ThresholdManager {
|
||||
this.needsCleanup = true;
|
||||
}
|
||||
|
||||
addPlotOptions(options, panel) {
|
||||
addFlotOptions(options, panel) {
|
||||
if (!panel.thresholds || panel.thresholds.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user