Browse Source

Table legend is not shown #149 (#151)

master
sanke1 6 years ago committed by rozetko
parent
commit
afb5872468
  1. 6
      src/graph_legend.ts
  2. 4
      src/graph_renderer.ts
  3. 3
      src/module.ts

6
src/graph_legend.ts

@ -140,13 +140,11 @@ export class GraphLegend {
}
if (this.panel.legend.sort) {
this.seriesList = _.sortBy(this.seriesList, function(series) {
return series.stats[this.panel.legend.sort];
});
this.seriesList = _.sortBy(this.seriesList, series => series.stats[this.panel.legend.sort]);
if (this.panel.legend.sortDesc) {
this.seriesList = this.seriesList.reverse();
}
}
}
// render first time for getting proper legend height
if (!this.panel.legend.rightSide) {

4
src/graph_renderer.ts

@ -122,7 +122,6 @@ export class GraphRenderer {
} else {
this._analyticController.addLabelSegment(segment);
}
this._renderPanel();
return;
}
@ -202,7 +201,6 @@ export class GraphRenderer {
// this.annotations = this.ctrl.annotations || [];
this._buildFlotPairs(this.data);
updateLegendValues(this.data, this.panel);
this._renderPanel();
if(this.tooltip.visible) {
var pos = this.plot.c2p(this._graphMousePosition);
var canvasOffset = this.$elem.find('.flot-overlay').offset();
@ -314,7 +312,7 @@ export class GraphRenderer {
}
// Function for rendering panel
private _renderPanel() {
public renderPanel() {
this.panelWidth = this.$elem.width();
if (this._shouldAbortRender()) {

3
src/module.ts

@ -386,8 +386,9 @@ class GraphCtrl extends MetricsPanelCtrl {
}
if(!this.analyticsController.graphLocked) {
this._graphLegend.render();
this._graphRenderer.render(data);
this._graphLegend.render();
this._graphRenderer.renderPanel();
}
}

Loading…
Cancel
Save