Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
433af083
Commit
433af083
authored
Dec 28, 2013
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed persistance of alias color changes
parent
210d4d13
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
36 deletions
+46
-36
src/app/panels/graphite/funcEditor.html
+0
-1
src/app/panels/graphite/legend.html
+32
-0
src/app/panels/graphite/module.html
+2
-17
src/app/panels/graphite/module.js
+12
-9
src/app/panels/graphite/seriesColor.html
+0
-9
No files found.
src/app/panels/graphite/funcEditor.html
View file @
433af083
...
...
@@ -10,7 +10,6 @@
</a>
<a
class=
"close"
ng-click=
"dismiss();"
href=
""
>
×
</a>
</div>
<div
class=
"editor-row"
ng-if=
"func.def.params.length"
>
...
...
src/app/panels/graphite/legend.html
0 → 100644
View file @
433af083
<span
ng-show=
"panel.legend"
ng-class=
"{'pull-right': series.yaxis === 2, 'hidden-series': hiddenSeries[series.alias]}"
ng-repeat=
'series in legend'
class=
"histogram-legend"
>
<i
class=
'icon-circle pointer'
ng-style=
"{color: series.color}"
bs-popover=
"'colorPopup.html'"
data-unique=
"1"
data-placement=
"bottomLeft"
>
</i>
<span
class=
'small histogram-legend-item'
>
<a
ng-click=
"toggleSeries(series)"
>
{{series.alias}}
</a>
</span>
</span>
<script
type=
"text/ng-template"
id=
"colorPopup.html"
>
<
div
style
=
"width: 150px;"
>
<
div
>
<
a
class
=
"close pull-right"
ng
-
click
=
"dismiss();"
href
=
""
>
×
<
/a
>
<
div
class
=
"clearfix"
><
/div
>
<
/div
>
<
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
=
"changeSeriesColor(series, color);dismiss();"
>
<
/i
>
<
/div
>
</script>
src/app/panels/graphite/module.html
View file @
433af083
...
...
@@ -50,23 +50,8 @@
<div
histogram-chart
class=
"pointer histogram-chart"
params=
"{{panel}}"
>
</div>
<div
class=
"grafana-legend-container"
>
<span
ng-show=
"panel.legend"
ng-class=
"{'pull-right': series.yaxis === 2, 'hidden-series': hiddenSeries[series.alias]}"
ng-repeat=
'series in legend'
class=
"histogram-legend"
>
<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}}
</a>
</span>
</span>
<div
ng-if=
"panel.legend"
class=
"grafana-legend-container"
>
<div
ng-include=
"'app/panels/graphite/legend.html'"
></div>
</div>
<div
class=
"panel-full-edit-tabs"
ng-if=
"inEditMode"
>
...
...
src/app/panels/graphite/module.js
View file @
433af083
...
...
@@ -193,14 +193,15 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
* zerofill:: Improves the accuracy of line charts at a small performance cost.
*/
zerofill
:
true
,
/** @scratch /panels/histogram/3
* derivative:: Show each point on the x-axis as the change from the previous point
*/
tooltip
:
{
value_type
:
'cumulative'
,
query_as_alias
:
true
},
targets
:
[]
targets
:
[],
aliasColors
:
{}
};
_
.
defaults
(
$scope
.
panel
,
_d
);
...
...
@@ -217,7 +218,6 @@ 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
;
...
...
@@ -335,9 +335,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
throw
{
message
:
'no data in response from graphite'
};
}
//console.log('Data from graphite:', results);
//console.log('nr datapoints from graphite: %d', results[0].datapoints.length);
var
tsOpts
=
{
interval
:
interval
,
start_date
:
range
&&
range
.
from
,
...
...
@@ -356,7 +353,7 @@ 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
color
=
$scope
.
panel
.
aliasColors
[
alias
]
||
$scope
.
colors
[
data
.
length
];
var
seriesInfo
=
{
alias
:
alias
,
...
...
@@ -438,6 +435,12 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
$emit
(
'render'
);
};
$scope
.
changeSeriesColor
=
function
(
series
,
color
)
{
series
.
color
=
color
;
$scope
.
panel
.
aliasColors
[
series
.
alias
]
=
series
.
color
;
$scope
.
render
();
}
$scope
.
toggleFullscreen
=
function
(
evt
)
{
if
(
$scope
.
showFullscreen
)
{
$rootScope
.
$emit
(
'panel-fullscreen-exit'
);
...
...
src/app/panels/graphite/seriesColor.html
deleted
100644 → 0
View file @
210d4d13
<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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment