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
f78501f3
Unverified
Commit
f78501f3
authored
Mar 16, 2020
by
Torkel Ödegaard
Committed by
GitHub
Mar 16, 2020
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AngularPanels: Fixed inner height calculation (#22796)
parent
1db06739
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
public/app/features/dashboard/dashgrid/PanelChromeAngular.tsx
+23
-4
public/app/plugins/panel/graph/graph.ts
+1
-1
No files found.
public/app/features/dashboard/dashgrid/PanelChromeAngular.tsx
View file @
f78501f3
...
...
@@ -11,11 +11,13 @@ import { PanelHeader } from './PanelHeader/PanelHeader';
import
{
getTimeSrv
,
TimeSrv
}
from
'../services/TimeSrv'
;
import
{
getAngularLoader
,
AngularComponent
}
from
'@grafana/runtime'
;
import
{
setPanelAngularComponent
}
from
'../state/reducers'
;
import
config
from
'app/core/config'
;
// Types
import
{
DashboardModel
,
PanelModel
}
from
'../state'
;
import
{
StoreState
}
from
'app/types'
;
import
{
LoadingState
,
DefaultTimeRange
,
PanelData
,
PanelPlugin
,
PanelEvents
}
from
'@grafana/data'
;
import
{
PANEL_BORDER
}
from
'app/core/constants'
;
interface
OwnProps
{
panel
:
PanelModel
;
...
...
@@ -135,15 +137,32 @@ export class PanelChromeAngularUnconnected extends PureComponent<Props, State> {
if
(
prevProps
.
width
!==
width
||
prevProps
.
height
!==
height
)
{
if
(
this
.
scopeProps
)
{
this
.
scopeProps
.
size
.
height
=
height
;
this
.
scopeProps
.
size
.
width
=
width
;
this
.
scopeProps
.
size
.
height
=
this
.
getInnerPanelHeight
()
;
this
.
scopeProps
.
size
.
width
=
this
.
getInnerPanelWidth
()
;
panel
.
events
.
emit
(
PanelEvents
.
panelSizeChanged
);
}
}
}
getInnerPanelHeight
()
{
const
{
plugin
,
height
}
=
this
.
props
;
const
{
theme
}
=
config
;
const
headerHeight
=
this
.
hasOverlayHeader
()
?
0
:
theme
.
panelHeaderHeight
;
const
chromePadding
=
plugin
.
noPadding
?
0
:
theme
.
panelPadding
;
return
height
-
headerHeight
-
chromePadding
*
2
-
PANEL_BORDER
;
}
getInnerPanelWidth
()
{
const
{
plugin
,
width
}
=
this
.
props
;
const
{
theme
}
=
config
;
const
chromePadding
=
plugin
.
noPadding
?
0
:
theme
.
panelPadding
;
return
width
-
chromePadding
*
2
-
PANEL_BORDER
;
}
loadAngularPanel
()
{
const
{
panel
,
dashboard
,
height
,
width
,
setPanelAngularComponent
}
=
this
.
props
;
const
{
panel
,
dashboard
,
setPanelAngularComponent
}
=
this
.
props
;
// if we have no element or already have loaded the panel return
if
(
!
this
.
element
)
{
...
...
@@ -156,7 +175,7 @@ export class PanelChromeAngularUnconnected extends PureComponent<Props, State> {
this
.
scopeProps
=
{
panel
:
panel
,
dashboard
:
dashboard
,
size
:
{
width
,
height
},
size
:
{
width
:
this
.
getInnerPanelWidth
(),
height
:
this
.
getInnerPanelHeight
()
},
};
setPanelAngularComponent
({
...
...
public/app/plugins/panel/graph/graph.ts
View file @
f78501f3
...
...
@@ -102,7 +102,7 @@ class GraphElement {
this
.
annotations
=
this
.
ctrl
.
annotations
||
[];
this
.
buildFlotPairs
(
this
.
data
);
const
graphHeight
=
this
.
elem
.
height
()
;
const
graphHeight
=
this
.
ctrl
.
height
;
updateLegendValues
(
this
.
data
,
this
.
panel
,
graphHeight
);
if
(
!
this
.
panel
.
legend
.
show
)
{
...
...
Kornkitt Poolsup
@Doratong24
mentioned in commit
0ad27a65
Mar 05, 2021
mentioned in commit
0ad27a65
mentioned in commit 0ad27a65962481664b1c08b4112bb6edc29db3ea
Toggle commit list
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