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
a2cca354
Commit
a2cca354
authored
Apr 28, 2019
by
ιεΈ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: remove auto width
parent
29c23b1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
src/components/Charts/Bar/index.js
src/components/Charts/Bar/index.js
+2
-5
No files found.
src/components/Charts/Bar/index.js
View file @
a2cca354
...
@@ -7,7 +7,6 @@ import styles from '../index.less';
...
@@ -7,7 +7,6 @@ import styles from '../index.less';
class
Bar
extends
Component
{
class
Bar
extends
Component
{
state
=
{
state
=
{
width
:
0
,
height
:
0
,
height
:
0
,
autoHideXLabels
:
false
,
autoHideXLabels
:
false
,
};
};
...
@@ -31,10 +30,9 @@ class Bar extends Component {
...
@@ -31,10 +30,9 @@ class Bar extends Component {
resizeObserver
()
{
resizeObserver
()
{
const
ro
=
new
ResizeObserver
(
entries
=>
{
const
ro
=
new
ResizeObserver
(
entries
=>
{
const
{
width
,
height
}
=
entries
[
0
].
contentRect
;
const
{
width
,
height
}
=
entries
[
0
].
contentRect
;
this
.
setState
(
(
preState
,
{
hasLegend
})
=>
{
this
.
setState
(
preState
=>
{
if
(
preState
.
width
!==
width
||
preState
.
height
!==
height
)
{
if
(
preState
.
width
!==
width
||
preState
.
height
!==
height
)
{
return
{
return
{
width
:
width
-
(
hasLegend
?
240
:
0
),
height
,
height
,
};
};
}
}
...
@@ -101,7 +99,7 @@ class Bar extends Component {
...
@@ -101,7 +99,7 @@ class Bar extends Component {
value
:
y
,
value
:
y
,
}),
}),
];
];
const
{
height
:
stateHeight
,
width
}
=
this
.
state
;
const
{
height
:
stateHeight
}
=
this
.
state
;
const
height
=
propsHeight
||
stateHeight
;
const
height
=
propsHeight
||
stateHeight
;
return
(
return
(
<
div
className
=
{
styles
.
chart
}
style
=
{{
height
}}
ref
=
{
this
.
handleRoot
}
>
<
div
className
=
{
styles
.
chart
}
style
=
{{
height
}}
ref
=
{
this
.
handleRoot
}
>
...
@@ -109,7 +107,6 @@ class Bar extends Component {
...
@@ -109,7 +107,6 @@ class Bar extends Component {
{
title
&&
<
h4
style
=
{{
marginBottom
:
20
}}
>
{
title
}
<
/h4>
}
{
title
&&
<
h4
style
=
{{
marginBottom
:
20
}}
>
{
title
}
<
/h4>
}
<
Chart
<
Chart
scale
=
{
scale
}
scale
=
{
scale
}
width
=
{
width
}
height
=
{
title
?
height
-
41
:
height
}
height
=
{
title
?
height
-
41
:
height
}
forceFit
=
{
forceFit
}
forceFit
=
{
forceFit
}
data
=
{
data
}
data
=
{
data
}
...
...
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