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
2dac9758
Commit
2dac9758
authored
May 13, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
began work on color by regex / series override for color, #590
parent
2bb63835
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
4 deletions
+50
-4
public/app/panels/graph/seriesOverridesCtrl.js
+26
-2
public/app/panels/graph/styleEditor.html
+3
-1
public/app/partials/colorpicker.html
+11
-0
public/app/services/popoverSrv.js
+9
-1
public/css/less/graph.less
+1
-0
No files found.
public/app/panels/graph/seriesOverridesCtrl.js
View file @
2dac9758
define
([
'angular'
,
'jquery'
,
'app'
,
'lodash'
,
],
function
(
angular
,
app
,
_
)
{
],
function
(
angular
,
jquery
,
app
,
_
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.panels.graph'
,
[]);
app
.
useModule
(
module
);
module
.
controller
(
'SeriesOverridesCtrl'
,
function
(
$scope
)
{
module
.
controller
(
'SeriesOverridesCtrl'
,
function
(
$scope
,
$element
,
popoverSrv
,
$timeout
)
{
$scope
.
overrideMenu
=
[];
$scope
.
currentOverrides
=
[];
$scope
.
override
=
$scope
.
override
||
{};
...
...
@@ -37,10 +38,32 @@ define([
$scope
.
addSeriesOverride
({
alias
:
subItem
.
value
,
lines
:
false
});
}
if
(
item
.
propertyName
===
'color'
)
{
$scope
.
openColorSelector
();
}
$scope
.
updateCurrentOverrides
();
$scope
.
render
();
};
$scope
.
colorSelected
=
function
(
color
)
{
$scope
.
override
[
'color'
]
=
color
;
$scope
.
updateCurrentOverrides
();
$scope
.
render
();
};
$scope
.
openColorSelector
=
function
()
{
var
popoverScope
=
$scope
.
$new
();
popoverScope
.
colorSelected
=
$scope
.
colorSelected
;
popoverSrv
.
show
({
element
:
$element
.
find
(
".dropdown"
),
placement
:
'top'
,
templateUrl
:
'app/partials/colorpicker.html'
,
scope
:
popoverScope
});
};
$scope
.
removeOverride
=
function
(
option
)
{
delete
$scope
.
override
[
option
.
propertyName
];
$scope
.
updateCurrentOverrides
();
...
...
@@ -75,6 +98,7 @@ define([
$scope
.
addOverrideOption
(
'Points'
,
'points'
,
[
true
,
false
]);
$scope
.
addOverrideOption
(
'Points Radius'
,
'pointradius'
,
[
1
,
2
,
3
,
4
,
5
]);
$scope
.
addOverrideOption
(
'Stack'
,
'stack'
,
[
true
,
false
,
2
,
3
,
4
,
5
]);
$scope
.
addOverrideOption
(
'Color'
,
'color'
,
[
'change'
]);
$scope
.
addOverrideOption
(
'Y-axis'
,
'yaxis'
,
[
1
,
2
]);
$scope
.
addOverrideOption
(
'Z-index'
,
'zindex'
,
[
-
1
,
-
2
,
-
3
,
0
,
1
,
2
,
3
]);
$scope
.
updateCurrentOverrides
();
...
...
public/app/panels/graph/styleEditor.html
View file @
2dac9758
...
...
@@ -94,6 +94,8 @@
</div>
</div>
<button
class=
"btn btn-success"
style=
"margin-top: 20px"
ng-click=
"addSeriesOverride()"
>
Add series override rule
</button>
<button
class=
"btn btn-inverse"
style=
"margin-top: 20px"
ng-click=
"addSeriesOverride()"
>
Add series specific option
</button>
</div>
</div>
public/app/partials/colorpicker.html
0 → 100644
View file @
2dac9758
<div
class=
"graph-legend-popover"
>
<a
class=
"close"
ng-click=
"dismiss();"
href=
""
>
×
</a>
<div
class=
"editor-row"
>
<i
ng-repeat=
"color in colors"
class=
"pointer fa fa-circle"
ng-style=
"{color:color}"
ng-click=
"colorSelected(color);dismiss();"
>
</i>
</div>
</div>
public/app/services/popoverSrv.js
View file @
2dac9758
...
...
@@ -21,12 +21,20 @@ function (angular, _) {
return
;
}
options
.
scope
.
dismiss
=
function
()
{
popover
=
options
.
element
.
data
(
'popover'
);
if
(
popover
)
{
popover
.
destroy
();
}
options
.
scope
.
$destroy
();
};
this
.
getTemplate
(
options
.
templateUrl
).
then
(
function
(
result
)
{
var
template
=
_
.
isString
(
result
)
?
result
:
result
.
data
;
options
.
element
.
popover
({
content
:
template
,
placement
:
'bottom'
,
placement
:
options
.
placement
||
'bottom'
,
html
:
true
});
...
...
public/css/less/graph.less
View file @
2dac9758
...
...
@@ -164,6 +164,7 @@
.graph-legend-popover {
width: 200px;
min-height: 100px;
label {
display: inline-block;
}
...
...
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