mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
added series color selector
This commit is contained in:
parent
2acfa83b76
commit
210d4d13eb
@ -4,14 +4,13 @@
|
|||||||
<a ng-click="removeFunction(func)">
|
<a ng-click="removeFunction(func)">
|
||||||
Remove
|
Remove
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
<a ng-click="helpFunction(func)">
|
<a ng-click="helpFunction(func)">
|
||||||
Help
|
Help
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
<a ng-click="dismiss()">
|
<a class="close" ng-click="dismiss();" href="">×</a>
|
||||||
Close
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="editor-row" ng-if="func.def.params.length">
|
<div class="editor-row" ng-if="func.def.params.length">
|
||||||
|
@ -55,7 +55,12 @@
|
|||||||
ng-class="{'pull-right': series.yaxis === 2, 'hidden-series': hiddenSeries[series.alias]}"
|
ng-class="{'pull-right': series.yaxis === 2, 'hidden-series': hiddenSeries[series.alias]}"
|
||||||
ng-repeat='series in legend'
|
ng-repeat='series in legend'
|
||||||
class="histogram-legend">
|
class="histogram-legend">
|
||||||
<i class='icon-circle' ng-style="{color: series.color}"></i>
|
<i class='icon-circle pointer'
|
||||||
|
ng-style="{color: series.color}"
|
||||||
|
bs-popover="'app/panels/graphite/seriesColor.html'"
|
||||||
|
data-unique="1"
|
||||||
|
data-placement="bottomLeft">
|
||||||
|
</i>
|
||||||
<span class='small histogram-legend-item'>
|
<span class='small histogram-legend-item'>
|
||||||
<a ng-click="toggleSeries(series)">
|
<a ng-click="toggleSeries(series)">
|
||||||
{{series.alias}}
|
{{series.alias}}
|
||||||
|
@ -217,7 +217,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
|
|||||||
$scope.editor = {index: 1};
|
$scope.editor = {index: 1};
|
||||||
$scope.editorTabs = _.union(['General'],_.pluck($scope.panelMeta.fullEditorTabs,'title'));
|
$scope.editorTabs = _.union(['General'],_.pluck($scope.panelMeta.fullEditorTabs,'title'));
|
||||||
$scope.hiddenSeries = {};
|
$scope.hiddenSeries = {};
|
||||||
|
$scope.aliasToColor = {};
|
||||||
// Always show the query if an alias isn't set. Users can set an alias if the query is too
|
// Always show the query if an alias isn't set. Users can set an alias if the query is too
|
||||||
// long
|
// long
|
||||||
$scope.panel.tooltip.query_as_alias = true;
|
$scope.panel.tooltip.query_as_alias = true;
|
||||||
@ -355,10 +355,12 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var target = graphiteSrv.match($scope.panel.targets, targetData.target);
|
var target = graphiteSrv.match($scope.panel.targets, targetData.target);
|
||||||
|
var alias = targetData.target;
|
||||||
|
var color = $scope.aliasToColor[alias] || $scope.colors[data.length];
|
||||||
|
|
||||||
var seriesInfo = {
|
var seriesInfo = {
|
||||||
alias: targetData.target,
|
alias: alias,
|
||||||
color: $scope.colors[data.length],
|
color: color,
|
||||||
enable: true,
|
enable: true,
|
||||||
yaxis: target.yaxis || 1
|
yaxis: target.yaxis || 1
|
||||||
};
|
};
|
||||||
|
8
src/app/panels/graphite/seriesColor.html
Normal file
8
src/app/panels/graphite/seriesColor.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<div style="width: 150px;">
|
||||||
|
<i ng-repeat="color in colors"
|
||||||
|
class="pointer"
|
||||||
|
ng-class="{'icon-circle-blank': color === series.color,'icon-circle': color !== series.color}"
|
||||||
|
ng-style="{color:color}"
|
||||||
|
ng-click="series.color = color;render();aliasToColor[series.alias] = color;">
|
||||||
|
</i>
|
||||||
|
</div>
|
@ -92,7 +92,7 @@ function (_) {
|
|||||||
addFuncDef({
|
addFuncDef({
|
||||||
name: 'aliasByNode',
|
name: 'aliasByNode',
|
||||||
category: categories.Special,
|
category: categories.Special,
|
||||||
params: [ { name: "node", type: "node", } ],
|
params: [ { name: "node", type: "select", options: [1,2,3,4,5,6,7,8,9,10,12] } ],
|
||||||
defaultParams: [3]
|
defaultParams: [3]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
src/css/bootstrap.dark.min.css
vendored
2
src/css/bootstrap.dark.min.css
vendored
File diff suppressed because one or more lines are too long
4
src/vendor/bootstrap/less/grafana.less
vendored
4
src/vendor/bootstrap/less/grafana.less
vendored
@ -229,12 +229,12 @@ input[type=text].func-param {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.grafana-func-editor {
|
.grafana-func-editor {
|
||||||
min-width: 90px;
|
min-width: 140px;
|
||||||
.grafana-func-editor-header {
|
.grafana-func-editor-header {
|
||||||
background: #41474c;
|
background: #41474c;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-bottom: 1px solid #353a3e;
|
border-bottom: 1px solid #353a3e;
|
||||||
padding: 3px 7px;
|
padding: 3px 5px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.editor-row {
|
.editor-row {
|
||||||
|
Loading…
Reference in New Issue
Block a user