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
6ca73f6d
Commit
6ca73f6d
authored
Sep 11, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not render graph when width is zero, avoids plot errors
parent
762dab61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
src/app/directives/grafanaGraph.js
+17
-9
No files found.
src/app/directives/grafanaGraph.js
View file @
6ca73f6d
...
...
@@ -15,7 +15,7 @@ function (angular, $, kbn, moment, _) {
restrict
:
'A'
,
template
:
'<div> </div>'
,
link
:
function
(
scope
,
elem
)
{
var
data
,
plot
,
annotations
;
var
data
,
annotations
;
var
hiddenData
=
{};
var
dashboard
=
scope
.
dashboard
;
var
legendSideLastValue
=
null
;
...
...
@@ -82,6 +82,10 @@ function (angular, $, kbn, moment, _) {
render_panel_as_graphite_png
(
data
);
return
true
;
}
if
(
elem
.
width
()
===
0
)
{
return
;
}
}
// Function for rendering panel
...
...
@@ -165,18 +169,22 @@ function (angular, $, kbn, moment, _) {
var
sortedSeries
=
_
.
sortBy
(
data
,
function
(
series
)
{
return
series
.
zindex
;
});
// if legend is to the right delay plot draw a few milliseconds
// so the legend width calculation can be done
function
callPlot
()
{
try
{
$
.
plot
(
elem
,
sortedSeries
,
options
);
}
catch
(
e
)
{
console
.
log
(
'flotcharts error'
,
e
);
}
addAxisLabels
();
}
if
(
shouldDelayDraw
(
panel
))
{
setTimeout
(
callPlot
,
50
);
legendSideLastValue
=
panel
.
legend
.
rightSide
;
setTimeout
(
function
()
{
plot
=
$
.
plot
(
elem
,
sortedSeries
,
options
);
addAxisLabels
();
},
50
);
}
else
{
plot
=
$
.
plot
(
elem
,
sortedSeries
,
options
);
addAxisLabels
();
callPlot
();
}
}
...
...
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