Added click events in graph to core eventbus (#7511)

This commit is contained in:
Dennis Wiemer
2017-02-15 08:47:20 +01:00
committed by Torkel Ödegaard
parent e573006283
commit 8b25ba6a7c
2 changed files with 5 additions and 0 deletions

View File

@@ -253,6 +253,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv) {
backgroundColor: null,
borderWidth: 0,
hoverable: true,
clickable: true,
color: '#c8c8c8',
margin: { left: 0, right: 0 },
},

View File

@@ -162,6 +162,10 @@ function ($, core) {
appEvents.emit('graph-hover', {pos: pos, panel: panel});
});
elem.bind("plotclick", function (event, pos, item) {
appEvents.emit('graph-click', {pos: pos, panel: panel, item: item});
});
this.clear = function(plot) {
$tooltip.detach();
plot.clearCrosshair();