Commit 210d4d13 by Torkel Ödegaard

added series color selector

parent 2acfa83b
......@@ -4,14 +4,13 @@
<a ng-click="removeFunction(func)">
Remove
</a>
|&nbsp;
&nbsp;&nbsp;
<a ng-click="helpFunction(func)">
Help
</a>
|&nbsp;
<a ng-click="dismiss()">
Close
</a>
&nbsp;&nbsp;
<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
};
......
<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 (_) {
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]
});
......
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 {
}
.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 {
......
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