Commit f4feb380 by Torkel Ödegaard

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

parent 82232e25
...@@ -101,6 +101,7 @@ function (angular, _, $) { ...@@ -101,6 +101,7 @@ function (angular, _, $) {
} }
function render() { function render() {
console.log('render legend');
if (firstRender) { if (firstRender) {
elem.append($container); elem.append($container);
$container.on('click', '.graph-legend-icon', openColorSelector); $container.on('click', '.graph-legend-icon', openColorSelector);
......
...@@ -4,6 +4,7 @@ import './graph'; ...@@ -4,6 +4,7 @@ import './graph';
import './legend'; import './legend';
import './series_overrides_ctrl'; import './series_overrides_ctrl';
import template from './template';
import moment from 'moment'; import moment from 'moment';
import kbn from 'app/core/utils/kbn'; import kbn from 'app/core/utils/kbn';
import _ from 'lodash'; import _ from 'lodash';
...@@ -83,7 +84,7 @@ var panelDefaults = { ...@@ -83,7 +84,7 @@ var panelDefaults = {
}; };
class GraphCtrl extends MetricsPanelCtrl { class GraphCtrl extends MetricsPanelCtrl {
static templateUrl = 'module.html'; static template = template;
hiddenSeries: any = {}; hiddenSeries: any = {};
seriesList: any = []; seriesList: any = [];
......
var template = `
<div class="graph-wrapper" ng-class="{'graph-legend-rightside': ctrl.panel.legend.rightSide}"> <div class="graph-wrapper" ng-class="{'graph-legend-rightside': ctrl.panel.legend.rightSide}">
<div class="graph-canvas-wrapper"> <div class="graph-canvas-wrapper">
<div ng-if="datapointsWarning" class="datapoints-warning"> <div ng-if="datapointsWarning" class="datapoints-warning">
<span class="small" ng-show="!datapointsCount"> <span class="small" ng-show="!datapointsCount">
No datapoints <tip>No datapoints returned from metric query</tip> No datapoints <tip>No datapoints returned from metric query</tip>
</span> </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> <span class="small" ng-show="datapointsOutside">
</div> 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 grafana-graph class="histogram-chart" ng-dblclick="ctrl.zoomOut()">
</div> </div>
</div> </div>
<div class="graph-legend-wrapper" ng-if="ctrl.panel.legend.show" graph-legend></div> <div class="graph-legend-wrapper" graph-legend></div>
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
`;
export default template;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment