mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
added series color selector
This commit is contained in:
parent
2acfa83b76
commit
210d4d13eb
@ -4,14 +4,13 @@
|
||||
<a ng-click="removeFunction(func)">
|
||||
Remove
|
||||
</a>
|
||||
|
|
||||
|
||||
<a ng-click="helpFunction(func)">
|
||||
Help
|
||||
</a>
|
||||
|
|
||||
<a ng-click="dismiss()">
|
||||
Close
|
||||
</a>
|
||||
|
||||
<a class="close" ng-click="dismiss();" href="">×</a>
|
||||
|
||||
</div>
|
||||
|
||||
<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-repeat='series in 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'>
|
||||
<a ng-click="toggleSeries(series)">
|
||||
{{series.alias}}
|
||||
|
@ -217,7 +217,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
|
||||
$scope.editor = {index: 1};
|
||||
$scope.editorTabs = _.union(['General'],_.pluck($scope.panelMeta.fullEditorTabs,'title'));
|
||||
$scope.hiddenSeries = {};
|
||||
|
||||
$scope.aliasToColor = {};
|
||||
// Always show the query if an alias isn't set. Users can set an alias if the query is too
|
||||
// long
|
||||
$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 alias = targetData.target;
|
||||
var color = $scope.aliasToColor[alias] || $scope.colors[data.length];
|
||||
|
||||
var seriesInfo = {
|
||||
alias: targetData.target,
|
||||
color: $scope.colors[data.length],
|
||||
alias: alias,
|
||||
color: color,
|
||||
enable: true,
|
||||
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({
|
||||
name: 'aliasByNode',
|
||||
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]
|
||||
});
|
||||
|
||||
|
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 {
|
||||
min-width: 90px;
|
||||
min-width: 140px;
|
||||
.grafana-func-editor-header {
|
||||
background: #41474c;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #353a3e;
|
||||
padding: 3px 7px;
|
||||
padding: 3px 5px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.editor-row {
|
||||
|
Loading…
Reference in New Issue
Block a user