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
b263b3ed
Commit
b263b3ed
authored
Feb 20, 2019
by
corpglory-dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change valueOptions
parent
7bb99620
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
public/app/plugins/panel/piechart/ValueOptions.tsx
+18
-5
public/app/plugins/panel/piechart/types.ts
+11
-4
No files found.
public/app/plugins/panel/piechart/ValueOptions.tsx
View file @
b263b3ed
import
React
,
{
PureComponent
}
from
'react'
;
import
{
FormLabel
,
PanelOptions
Props
,
PanelOptions
Group
,
Select
}
from
'@grafana/ui'
;
import
{
FormLabel
,
PanelOptionsGroup
,
Select
}
from
'@grafana/ui'
;
import
UnitPicker
from
'app/core/components/Select/UnitPicker'
;
import
{
PiechartOptions
}
from
'./types'
;
import
{
Piechart
Value
Options
}
from
'./types'
;
const
statOptions
=
[
{
value
:
'min'
,
label
:
'Min'
},
...
...
@@ -13,10 +13,23 @@ const statOptions = [
const
labelWidth
=
6
;
export
default
class
ValueOptions
extends
PureComponent
<
PanelOptionsProps
<
PiechartOptions
>>
{
onUnitChange
=
unit
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
unit
:
unit
.
value
});
export
interface
Props
{
options
:
PiechartValueOptions
;
onChange
:
(
valueOptions
:
PiechartValueOptions
)
=>
void
;
}
export
default
class
ValueOptions
extends
PureComponent
<
Props
>
{
onUnitChange
=
unit
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
unit
:
unit
.
value
,
});
onStatChange
=
stat
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
stat
:
stat
.
value
});
onStatChange
=
stat
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
stat
:
stat
.
value
,
});
render
()
{
const
{
stat
,
unit
}
=
this
.
props
.
options
;
...
...
public/app/plugins/panel/piechart/types.ts
View file @
b263b3ed
export
interface
PiechartOptions
{
pieType
:
string
;
unit
:
string
;
stat
:
string
;
strokeWidth
:
number
;
valueOptions
:
PiechartValueOptions
;
// TODO: Options for Legend / Combine components
}
export
interface
PiechartValueOptions
{
unit
:
string
;
stat
:
string
;
}
export
const
defaults
:
PiechartOptions
=
{
pieType
:
'pie'
,
unit
:
'short'
,
stat
:
'current'
,
strokeWidth
:
1
,
valueOptions
:
{
unit
:
'short'
,
stat
:
'current'
,
},
};
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