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
1ccde2a1
Unverified
Commit
1ccde2a1
authored
Jan 15, 2021
by
Torkel Ödegaard
Committed by
GitHub
Jan 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AngularGraph: Fixes issues with legend wrapping after legend refactoring (#30283)
parent
d6b46818
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx
+11
-9
public/sass/components/_panel_graph.scss
+10
-10
No files found.
public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx
View file @
1ccde2a1
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
{
TimeSeries
}
from
'app/core/core'
;
import
{
TimeSeries
}
from
'app/core/core'
;
import
{
Icon
,
SeriesColorPicker
}
from
'@grafana/ui'
;
import
{
SeriesColorPicker
,
SeriesIcon
}
from
'@grafana/ui'
;
import
{
selectors
}
from
'@grafana/e2e-selectors'
;
import
{
selectors
}
from
'@grafana/e2e-selectors'
;
export
const
LEGEND_STATS
=
[
'min'
,
'max'
,
'avg'
,
'current'
,
'total'
];
export
const
LEGEND_STATS
=
[
'min'
,
'max'
,
'avg'
,
'current'
,
'total'
];
...
@@ -105,7 +105,9 @@ export class LegendItem extends PureComponent<LegendItemProps, LegendItemState>
...
@@ -105,7 +105,9 @@ export class LegendItem extends PureComponent<LegendItemProps, LegendItemState>
if
(
asTable
)
{
if
(
asTable
)
{
return
(
return
(
<
tr
className=
{
`graph-legend-series ${seriesOptionClasses}`
}
>
<
tr
className=
{
`graph-legend-series ${seriesOptionClasses}`
}
>
<
td
>
{
seriesLabel
}
</
td
>
<
td
>
<
div
className=
"graph-legend-series__table-name"
>
{
seriesLabel
}
</
div
>
</
td
>
{
valueItems
}
{
valueItems
}
</
tr
>
</
tr
>
);
);
...
@@ -170,10 +172,6 @@ interface LegendSeriesIconState {
...
@@ -170,10 +172,6 @@ interface LegendSeriesIconState {
color
:
string
;
color
:
string
;
}
}
function
SeriesIcon
({
color
}:
{
color
:
string
})
{
return
<
Icon
name=
"minus"
style=
{
{
color
}
}
/>;
}
class
LegendSeriesIcon
extends
PureComponent
<
LegendSeriesIconProps
,
LegendSeriesIconState
>
{
class
LegendSeriesIcon
extends
PureComponent
<
LegendSeriesIconProps
,
LegendSeriesIconState
>
{
static
defaultProps
:
Partial
<
LegendSeriesIconProps
>
=
{
static
defaultProps
:
Partial
<
LegendSeriesIconProps
>
=
{
yaxis
:
undefined
,
yaxis
:
undefined
,
...
@@ -197,9 +195,13 @@ class LegendSeriesIcon extends PureComponent<LegendSeriesIconProps, LegendSeries
...
@@ -197,9 +195,13 @@ class LegendSeriesIcon extends PureComponent<LegendSeriesIconProps, LegendSeries
enableNamedColors
enableNamedColors
>
>
{
({
ref
,
showColorPicker
,
hideColorPicker
})
=>
(
{
({
ref
,
showColorPicker
,
hideColorPicker
})
=>
(
<
span
ref=
{
ref
}
onClick=
{
showColorPicker
}
onMouseLeave=
{
hideColorPicker
}
>
<
SeriesIcon
<
SeriesIcon
color=
{
this
.
props
.
color
}
/>
color=
{
this
.
props
.
color
}
</
span
>
ref=
{
ref
}
onClick=
{
showColorPicker
}
onMouseLeave=
{
hideColorPicker
}
className=
"graph-legend-icon"
/>
)
}
)
}
</
SeriesColorPicker
>
</
SeriesColorPicker
>
);
);
...
...
public/sass/components/_panel_graph.scss
View file @
1ccde2a1
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
display
:
inline
;
display
:
inline
;
cursor
:
pointer
;
cursor
:
pointer
;
white-space
:
nowrap
;
white-space
:
nowrap
;
font-size
:
85%
;
font-size
:
12px
;
text-align
:
left
;
text-align
:
left
;
&.
current
:
:
before
{
&.
current
:
:
before
{
content
:
'Current: '
;
content
:
'Current: '
;
...
@@ -105,6 +105,8 @@
...
@@ -105,6 +105,8 @@
float
:
left
;
float
:
left
;
white-space
:
nowrap
;
white-space
:
nowrap
;
padding-left
:
10px
;
padding-left
:
10px
;
display
:
flex
;
align-items
:
center
;
&
--right-y
{
&
--right-y
{
float
:
right
;
float
:
right
;
...
@@ -146,17 +148,12 @@
...
@@ -146,17 +148,12 @@
float
:
none
;
float
:
none
;
display
:
table-cell
;
display
:
table-cell
;
white-space
:
nowrap
;
white-space
:
nowrap
;
padding
:
2px
10px
;
padding
:
2px
;
text-align
:
right
;
text-align
:
right
;
}
}
.graph-legend-icon
{
.graph-legend-icon
{
width
:
5px
;
cursor
:
pointer
;
padding
:
0
;
top
:
0
;
.fa
{
top
:
4px
;
}
}
}
.graph-legend-value
{
.graph-legend-value
{
...
@@ -164,9 +161,7 @@
...
@@ -164,9 +161,7 @@
}
}
.graph-legend-alias
{
.graph-legend-alias
{
padding-left
:
7px
;
text-align
:
left
;
text-align
:
left
;
width
:
95%
;
max-width
:
650px
;
max-width
:
650px
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
overflow
:
hidden
;
overflow
:
hidden
;
...
@@ -198,6 +193,11 @@
...
@@ -198,6 +193,11 @@
}
}
}
}
.graph-legend-series__table-name
{
display
:
flex
;
align-items
:
center
;
}
.graph-legend-series-hidden
{
.graph-legend-series-hidden
{
.graph-legend-value
,
.graph-legend-value
,
.graph-legend-alias
{
.graph-legend-alias
{
...
...
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