fix(graph): fixed issue with graph and legend to the right in snapshots, closes #4400

This commit is contained in:
Torkel Ödegaard 2016-03-20 11:17:53 +01:00
parent 82232e2530
commit f4feb38089
4 changed files with 31 additions and 23 deletions

View File

@ -101,6 +101,7 @@ function (angular, _, $) {
}
function render() {
console.log('render legend');
if (firstRender) {
elem.append($container);
$container.on('click', '.graph-legend-icon', openColorSelector);

View File

@ -1,22 +0,0 @@
<div class="graph-wrapper" ng-class="{'graph-legend-rightside': ctrl.panel.legend.rightSide}">
<div class="graph-canvas-wrapper">
<div ng-if="datapointsWarning" class="datapoints-warning">
<span class="small" ng-show="!datapointsCount">
No datapoints <tip>No datapoints returned from metric query</tip>
</span>
<span class="small" ng-show="datapointsOutside">Datapoints outside time range <tip>Can be caused by timezone mismatch between browser and graphite server</tip></span>
</div>
<div grafana-graph class="histogram-chart" ng-dblclick="ctrl.zoomOut()">
</div>
</div>
<div class="graph-legend-wrapper" ng-if="ctrl.panel.legend.show" graph-legend></div>
</div>
<div class="clearfix"></div>

View File

@ -4,6 +4,7 @@ import './graph';
import './legend';
import './series_overrides_ctrl';
import template from './template';
import moment from 'moment';
import kbn from 'app/core/utils/kbn';
import _ from 'lodash';
@ -83,7 +84,7 @@ var panelDefaults = {
};
class GraphCtrl extends MetricsPanelCtrl {
static templateUrl = 'module.html';
static template = template;
hiddenSeries: any = {};
seriesList: any = [];

View File

@ -0,0 +1,28 @@
var template = `
<div class="graph-wrapper" ng-class="{'graph-legend-rightside': ctrl.panel.legend.rightSide}">
<div class="graph-canvas-wrapper">
<div ng-if="datapointsWarning" class="datapoints-warning">
<span class="small" ng-show="!datapointsCount">
No datapoints <tip>No datapoints returned from metric query</tip>
</span>
<span class="small" ng-show="datapointsOutside">
Datapoints outside time range
<tip>Can be caused by timezone mismatch between browser and graphite server</tip>
</span>
</div>
<div grafana-graph class="histogram-chart" ng-dblclick="ctrl.zoomOut()">
</div>
</div>
<div class="graph-legend-wrapper" graph-legend></div>
</div>
<div class="clearfix"></div>
`;
export default template;