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
4d6bb8b6
Commit
4d6bb8b6
authored
Jan 25, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
progress on translating grafana/flot options to graphite png renderer options
parent
82da75bc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
3 deletions
+33
-3
src/app/panels/graphite/module.js
+32
-2
src/app/panels/graphite/styleEditor.html
+1
-1
No files found.
src/app/panels/graphite/module.js
View file @
4d6bb8b6
...
...
@@ -320,13 +320,14 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
receiveGraphiteData
=
function
(
results
)
{
$scope
.
panelMeta
.
loading
=
false
;
$scope
.
legend
=
[];
if
(
_
.
isString
(
results
))
{
$scope
.
render
(
results
);
return
;
}
results
=
results
.
data
;
$scope
.
legend
=
[];
var
data
=
[];
_
.
each
(
results
,
function
(
targetData
)
{
...
...
@@ -481,8 +482,37 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
if
(
_
.
isString
(
data
))
{
elem
.
html
(
'<img src="'
+
data
+
'"></img>'
);
render_panel_as_graphite_png
(
);
return
;
}
addAxisLabels
();
}
function
render_panel_as_graphite_png
()
{
data
+=
'&width='
+
elem
.
width
();
data
+=
'&height='
+
elem
.
css
(
'height'
).
replace
(
'px'
,
''
);
data
+=
'&bgcolor=1f1f1f'
;
// @grayDarker & @kibanaPanelBackground
data
+=
'&fgcolor=BBBFC2'
;
// @textColor & @grayLighter
data
+=
scope
.
panel
.
stack
?
'&areaMode=stacked'
:
''
data
+=
scope
.
panel
.
fill
!==
0
?
(
'&areaAlpha='
+
(
scope
.
panel
.
fill
/
10
).
toFixed
(
1
))
:
''
;
data
+=
scope
.
panel
.
linewidth
!==
0
?
'&lineWidth='
+
scope
.
panel
.
linewidth
:
''
;
data
+=
scope
.
panel
.
steppedLine
?
'&lineMode=staircase'
:
''
;
switch
(
scope
.
panel
.
nullPointMode
)
{
case
'connected'
:
data
+=
'&lineMode=connected'
;
break
;
case
'null'
:
break
;
// graphite default lineMode
case
'null as zero'
:
data
+=
"&drawNullAsZero=true"
;
break
;
}
elem
.
html
(
'<img src="'
+
data
+
'"></img>'
);
}
function
addAxisLabels
()
{
});
src/app/panels/graphite/styleEditor.html
View file @
4d6bb8b6
...
...
@@ -59,7 +59,7 @@
<select
class=
"input-medium"
ng-model=
"panel.nullPointMode"
ng-options=
"f for f in ['connected', 'null', 'null as zero']"
ng-change=
"render()"
></select>
</div>
<div
class=
"editor-option"
>
<label
class=
"small"
>
St
epped lines
</label><input
type=
"checkbox"
ng-model=
"panel.steppedLine"
ng-checked=
"panel.steppedLine"
ng-change=
"render()"
>
<label
class=
"small"
>
St
aircase line
</label><input
type=
"checkbox"
ng-model=
"panel.steppedLine"
ng-checked=
"panel.steppedLine"
ng-change=
"render()"
>
</div>
</div>
<div
class=
"section"
>
...
...
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