Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
c3-closed
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
charts
c3-closed
Commits
6cc574ed
Commit
6cc574ed
authored
Feb 09, 2016
by
Дмитрий Никулин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix animation on chart settings change
Added transitionDuration property to chartData. Set it to 0 or null to get rid of transition. Number values mean transition length in ms.
parent
114613a6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
c3.js
c3.js
+17
-7
No files found.
c3.js
View file @
6cc574ed
...
...
@@ -894,14 +894,16 @@
var
$$
=
this
,
config
=
$$
.
config
,
transitions
;
options
=
options
||
{};
// same with redraw
options
.
withTransition
=
getOption
(
options
,
"withTransition"
,
true
)
;
options
.
withTransition
=
config
.
transition_duration
?
getOption
(
options
,
"withTransition"
,
true
)
:
false
;
options
.
withTransform
=
getOption
(
options
,
"withTransform"
,
false
);
options
.
withLegend
=
getOption
(
options
,
"withLegend"
,
false
);
// NOT same with redraw
options
.
withUpdateXDomain
=
true
;
options
.
withUpdateOrgXDomain
=
true
;
options
.
withTransitionForExit
=
false
;
options
.
withTransitionForTransform
=
getOption
(
options
,
"withTransitionForTransform"
,
options
.
withTransition
);
options
.
withTransitionForTransform
=
config
.
transition_duration
?
getOption
(
options
,
"withTransitionForTransform"
,
options
.
withTransition
)
:
false
;
// MEMO: this needs to be called before updateLegend and it means this ALWAYS needs to be called)
$$
.
updateSizes
();
// MEMO: called in updateLegend in redraw if withLegend
...
...
@@ -4071,8 +4073,15 @@
};
};
c3_chart_internal_fn
.
transformLegend
=
function
(
withTransition
)
{
var
$$
=
this
;
(
withTransition
?
$$
.
legend
.
transition
()
:
$$
.
legend
).
attr
(
"transform"
,
$$
.
getTranslate
(
'legend'
));
var
$$
=
this
,
legend
=
$$
.
legend
,
duration
=
$$
.
config
.
transition_duration
;
// Turn off transitions if duration was not specified in config
if
(
withTransition
&&
duration
){
legend
=
legend
.
transition
().
duration
(
duration
);
}
legend
.
attr
(
"transform"
,
$$
.
getTranslate
(
'legend'
));
};
c3_chart_internal_fn
.
updateLegendStep
=
function
(
step
)
{
this
.
legendStep
=
step
;
...
...
@@ -4684,17 +4693,18 @@
var
axisXLabel
=
$$
.
main
.
select
(
'.'
+
CLASS
.
axisX
+
' .'
+
CLASS
.
axisXLabel
),
axisYLabel
=
$$
.
main
.
select
(
'.'
+
CLASS
.
axisY
+
' .'
+
CLASS
.
axisYLabel
),
axisY2Label
=
$$
.
main
.
select
(
'.'
+
CLASS
.
axisY2
+
' .'
+
CLASS
.
axisY2Label
);
(
withTransition
?
axisXLabel
.
transition
()
:
axisXLabel
)
var
duration
=
$$
.
config
.
transition_duration
;
(
withTransition
?
axisXLabel
.
transition
().
duration
(
duration
)
:
axisXLabel
)
.
attr
(
"x"
,
$$
.
xForXAxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForXAxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForXAxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForXAxisLabel
.
bind
(
$$
));
(
withTransition
?
axisYLabel
.
transition
()
:
axisYLabel
)
(
withTransition
?
axisYLabel
.
transition
()
.
duration
(
duration
)
:
axisYLabel
)
.
attr
(
"x"
,
$$
.
xForYAxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForYAxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForYAxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForYAxisLabel
.
bind
(
$$
));
(
withTransition
?
axisY2Label
.
transition
()
:
axisY2Label
)
(
withTransition
?
axisY2Label
.
transition
()
.
duration
(
duration
)
:
axisY2Label
)
.
attr
(
"x"
,
$$
.
xForY2AxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForY2AxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForY2AxisLabel
.
bind
(
$$
))
...
...
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