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
d04c138e
Commit
d04c138e
authored
Nov 09, 2017
by
nikogu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed:
https://github.com/ant-design/ant-design-pro/issues/130
parent
cfa80630
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
src/components/Charts/TimelineChart/index.js
src/components/Charts/TimelineChart/index.js
+8
-0
src/components/Charts/demo/timeline-chart.md
src/components/Charts/demo/timeline-chart.md
+1
-1
No files found.
src/components/Charts/TimelineChart/index.js
View file @
d04c138e
...
@@ -64,6 +64,12 @@ class TimelineChart extends Component {
...
@@ -64,6 +64,12 @@ class TimelineChart extends Component {
position
:
'
top
'
,
position
:
'
top
'
,
});
});
let
max
;
if
(
data
[
0
]
&&
data
[
0
].
y1
&&
data
[
0
].
y2
)
{
max
=
Math
.
max
(
data
.
sort
((
a
,
b
)
=>
b
.
y1
-
a
.
y1
)[
0
].
y1
,
data
.
sort
((
a
,
b
)
=>
b
.
y2
-
a
.
y2
)[
0
].
y2
);
}
chart
.
source
(
data
,
{
chart
.
source
(
data
,
{
x
:
{
x
:
{
type
:
'
timeCat
'
,
type
:
'
timeCat
'
,
...
@@ -73,10 +79,12 @@ class TimelineChart extends Component {
...
@@ -73,10 +79,12 @@ class TimelineChart extends Component {
},
},
y1
:
{
y1
:
{
alias
:
titleMap
.
y1
,
alias
:
titleMap
.
y1
,
max
,
min
:
0
,
min
:
0
,
},
},
y2
:
{
y2
:
{
alias
:
titleMap
.
y2
,
alias
:
titleMap
.
y2
,
max
,
min
:
0
,
min
:
0
,
},
},
});
});
...
...
src/components/Charts/demo/timeline-chart.md
View file @
d04c138e
...
@@ -12,7 +12,7 @@ const chartData = [];
...
@@ -12,7 +12,7 @@ const chartData = [];
for
(
let
i
=
0
;
i
<
20
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
20
;
i
+=
1
)
{
chartData
.
push
({
chartData
.
push
({
x
:
(
new
Date
().
getTime
())
+
(
1000
*
60
*
30
*
i
),
x
:
(
new
Date
().
getTime
())
+
(
1000
*
60
*
30
*
i
),
y1
:
Math
.
floor
(
Math
.
random
()
*
100
)
+
10
,
y1
:
Math
.
floor
(
Math
.
random
()
*
100
)
+
10
00
,
y2
:
Math
.
floor
(
Math
.
random
()
*
100
)
+
10
,
y2
:
Math
.
floor
(
Math
.
random
()
*
100
)
+
10
,
});
});
}
}
...
...
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