Skip to content

Commit 88ec307

Browse files
committed
fix(graph panel): fixed issue with graph axis labels
1 parent c285692 commit 88ec307

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

public/app/plugins/panel/graph/graph.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
140140

141141
// add left axis labels
142142
if (panel.yaxes[0].label) {
143-
var yaxisLabel = $("<div class='axisLabel left-yaxis-label'></div>")
143+
var yaxisLabel = $("<div class='axisLabel left-yaxis-label flot-temp-elem'></div>")
144144
.text(panel.yaxes[0].label)
145145
.appendTo(elem);
146146

@@ -149,7 +149,7 @@ module.directive('grafanaGraph', function($rootScope, timeSrv) {
149149

150150
// add right axis labels
151151
if (panel.yaxes[1].label) {
152-
var rightLabel = $("<div class='axisLabel right-yaxis-label'></div>")
152+
var rightLabel = $("<div class='axisLabel right-yaxis-label flot-temp-elem'></div>")
153153
.text(panel.yaxes[1].label)
154154
.appendTo(elem);
155155

public/app/plugins/panel/graph/jquery.flot.events.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function ($, _, angular, Drop) {
235235
top = o.top + this._plot.height();
236236
left = xaxis.p2c(event.min) + o.left;
237237

238-
var line = $('<div class="events_line"></div>').css({
238+
var line = $('<div class="events_line flot-temp-elem"></div>').css({
239239
"position": "absolute",
240240
"opacity": 0.8,
241241
"left": left + 'px',
@@ -365,20 +365,12 @@ function ($, _, angular, Drop) {
365365

366366
plot.hooks.draw.push(function(plot) {
367367
var options = plot.getOptions();
368-
var container = plot.getPlaceholder();
369-
var containerElem = container[0];
370-
371-
if (containerElem.removeEventsElements) {
372-
container.find(".events_line").remove();
373-
containerElem.removeEventsElements = false;
374-
}
375368

376369
if (eventMarkers.eventsEnabled) {
377370
// check for first run
378371
if (eventMarkers.getEvents().length < 1) {
379372
eventMarkers.setTypes(options.events.types);
380373
eventMarkers.setupEvents(options.events.data);
381-
containerElem.removeEventsElements = true;
382374
} else {
383375
eventMarkers.updateEvents();
384376
}

public/vendor/flot/jquery.flot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Licensed under the MIT license.
248248
// Create the text layer container, if it doesn't exist
249249

250250
if (this.textContainer == null) {
251-
this.textContainer = $("<div class='flot-text'></div>")
251+
this.textContainer = $("<div class='flot-text flot-temp-elem'></div>")
252252
.css({
253253
position: "absolute",
254254
top: 0,
@@ -1319,7 +1319,7 @@ Licensed under the MIT license.
13191319
// Make sure the placeholder is clear of everything except canvases
13201320
// from a previous plot in this container that we'll try to re-use.
13211321

1322-
placeholder.find(".flot-text").remove();
1322+
placeholder.find(".flot-temp-elem").remove();
13231323

13241324
if (placeholder.css("position") == 'static')
13251325
placeholder.css("position", "relative"); // for positioning labels and overlay

0 commit comments

Comments
 (0)