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
66f6b05d
Unverified
Commit
66f6b05d
authored
Jun 15, 2020
by
Harrison Shoff
Committed by
GitHub
Jun 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GraphPanel: Make legend values clickable series toggles (#25581)
fixes: #25402
parent
91c24e1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx
+20
-7
No files found.
public/app/plugins/panel/graph/Legend/LegendSeriesItem.tsx
View file @
66f6b05d
...
...
@@ -71,7 +71,13 @@ export class LegendItem extends PureComponent<LegendItemProps, LegendItemState>
if
(
this
.
props
[
valueName
])
{
const
valueFormatted
=
series
.
formatValue
(
series
.
stats
[
valueName
]);
legendValueItems
.
push
(
<
LegendValue
key=
{
valueName
}
valueName=
{
valueName
}
value=
{
valueFormatted
}
asTable=
{
asTable
}
/>
<
LegendValue
key=
{
valueName
}
valueName=
{
valueName
}
value=
{
valueFormatted
}
asTable=
{
asTable
}
onValueClick=
{
this
.
onLabelClick
}
/>
);
}
}
...
...
@@ -196,13 +202,20 @@ interface LegendValueProps {
value
:
string
;
valueName
:
string
;
asTable
?:
boolean
;
onValueClick
?:
(
event
:
any
)
=>
void
;
}
function
LegendValue
(
props
:
LegendValueProps
)
{
const
value
=
props
.
value
;
const
valueName
=
props
.
valueName
;
if
(
props
.
asTable
)
{
return
<
td
className=
{
`graph-legend-value ${valueName}`
}
>
{
value
}
</
td
>;
function
LegendValue
({
value
,
valueName
,
asTable
,
onValueClick
}:
LegendValueProps
)
{
if
(
asTable
)
{
return
(
<
td
className=
{
`graph-legend-value ${valueName}`
}
onClick=
{
onValueClick
}
>
{
value
}
</
td
>
);
}
return
<
div
className=
{
`graph-legend-value ${valueName}`
}
>
{
value
}
</
div
>;
return
(
<
div
className=
{
`graph-legend-value ${valueName}`
}
onClick=
{
onValueClick
}
>
{
value
}
</
div
>
);
}
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