Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linweijiong
jinfa-platform
Commits
444b2467
Commit
444b2467
authored
May 13, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 strokeWidth 线条宽度属性
parent
600d7b44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
index.tsx
src/components/Charts/Gauge/index.tsx
+9
-6
No files found.
src/components/Charts/Gauge/index.tsx
View file @
444b2467
...
...
@@ -20,6 +20,10 @@ export interface GaugeProps {
formatter
?:
(
value
:
string
)
=>
string
;
// 格式化内容
formatContent
?:
(
value
:
number
)
=>
string
;
/**
* 线条宽度
*/
strokeWidth
?:
number
,
}
const
defaultFormatter
=
(
val
:
string
):
string
=>
{
...
...
@@ -85,6 +89,7 @@ const Gauge: React.FC<GaugeProps> = (props) => {
formatContent
=
defaultFormatContent
,
color
=
'#2F9CFF'
,
bgColor
=
'#F0F2F5'
,
strokeWidth
=
10
,
}
=
props
;
const
cols
=
{
value
:
{
...
...
@@ -128,12 +133,10 @@ const Gauge: React.FC<GaugeProps> = (props) => {
label=
{
{
offset
:
-
24
,
formatter
,
textStyle
,
style
:
textStyle
,
}
}
subTickLine=
{
null
}
tickLine=
{
{
length
:
-
12
,
}
}
tickLine=
{
null
}
grid=
{
null
}
/>
<
Point
...
...
@@ -148,7 +151,7 @@ const Gauge: React.FC<GaugeProps> = (props) => {
end=
{
[
10
,
0.965
]
}
style=
{
{
stroke
:
bgColor
,
lineWidth
:
10
,
lineWidth
:
strokeWidth
,
lineDash
:
null
,
}
}
/>
...
...
@@ -157,7 +160,7 @@ const Gauge: React.FC<GaugeProps> = (props) => {
end=
{
[
data
[
0
].
value
,
0.965
]
}
style=
{
{
stroke
:
color
,
lineWidth
:
10
,
lineWidth
:
strokeWidth
,
lineDash
:
null
,
}
}
/>
...
...
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