Commit 210d4d13 by Torkel Ödegaard

added series color selector

parent 2acfa83b
...@@ -4,14 +4,13 @@ ...@@ -4,14 +4,13 @@
<a ng-click="removeFunction(func)"> <a ng-click="removeFunction(func)">
Remove Remove
</a> </a>
|&nbsp; &nbsp;&nbsp;
<a ng-click="helpFunction(func)"> <a ng-click="helpFunction(func)">
Help Help
</a> </a>
|&nbsp; &nbsp;&nbsp;
<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 @@ ...@@ -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) { ...@@ -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) { ...@@ -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
}; };
......
<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>
\ No newline at end of file
...@@ -92,7 +92,7 @@ function (_) { ...@@ -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]
}); });
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -229,12 +229,12 @@ input[type=text].func-param { ...@@ -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 {
......
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