Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
41300f47
Commit
41300f47
authored
Oct 28, 2018
by
mmmaomao21
Committed by
陈帅
Oct 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决图表Gauge中值显示的浮点数bug (#2682)
parent
d57aae18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/components/Charts/Gauge/index.js
src/components/Charts/Gauge/index.js
+3
-3
No files found.
src/components/Charts/Gauge/index.js
View file @
41300f47
...
@@ -72,7 +72,7 @@ class Gauge extends React.Component {
...
@@ -72,7 +72,7 @@ class Gauge extends React.Component {
nice
:
true
,
nice
:
true
,
},
},
};
};
const
data
=
[{
value
:
percent
/
10
}];
const
data
=
[{
value
:
percent
}];
return
(
return
(
<
Chart
height
=
{
height
}
data
=
{
data
}
scale
=
{
cols
}
padding
=
{[
-
16
,
0
,
16
,
0
]}
forceFit
=
{
forceFit
}
>
<
Chart
height
=
{
height
}
data
=
{
data
}
scale
=
{
cols
}
padding
=
{[
-
16
,
0
,
16
,
0
]}
forceFit
=
{
forceFit
}
>
<
Coord
type
=
"
polar
"
startAngle
=
{
-
1.25
*
Math
.
PI
}
endAngle
=
{
0.25
*
Math
.
PI
}
radius
=
{
0.8
}
/
>
<
Coord
type
=
"
polar
"
startAngle
=
{
-
1.25
*
Math
.
PI
}
endAngle
=
{
0.25
*
Math
.
PI
}
radius
=
{
0.8
}
/
>
...
@@ -134,7 +134,7 @@ class Gauge extends React.Component {
...
@@ -134,7 +134,7 @@ class Gauge extends React.Component {
<
Arc
<
Arc
zIndex
=
{
1
}
zIndex
=
{
1
}
start
=
{[
0
,
0.965
]}
start
=
{[
0
,
0.965
]}
end
=
{[
data
[
0
].
value
,
0.965
]}
end
=
{[
data
[
0
].
value
/
10
,
0.965
]}
style
=
{{
style
=
{{
stroke
:
color
,
stroke
:
color
,
lineWidth
:
10
,
lineWidth
:
10
,
...
@@ -146,7 +146,7 @@ class Gauge extends React.Component {
...
@@ -146,7 +146,7 @@ class Gauge extends React.Component {
<div style="width: 300px;text-align: center;font-size: 12px!important;">
<div style="width: 300px;text-align: center;font-size: 12px!important;">
<p style="font-size: 14px; color: rgba(0,0,0,0.43);margin: 0;">
${
title
}
</p>
<p style="font-size: 14px; color: rgba(0,0,0,0.43);margin: 0;">
${
title
}
</p>
<p style="font-size: 24px;color: rgba(0,0,0,0.85);margin: 0;">
<p style="font-size: 24px;color: rgba(0,0,0,0.85);margin: 0;">
${
data
[
0
].
value
*
10
}
%
${
data
[
0
].
value
}
%
</p>
</p>
</div>`
}
</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