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
e8b7f734
Commit
e8b7f734
authored
Mar 31, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support multiple unload
parent
d074ef8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
c3.js
c3.js
+19
-13
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
e8b7f734
...
...
@@ -3389,6 +3389,21 @@
done
();
}
function
unload
(
targetIds
)
{
targetIds
.
forEach
(
function
(
id
)
{
c3
.
data
.
targets
=
c3
.
data
.
targets
.
filter
(
function
(
t
)
{
return
t
.
id
!==
id
;
});
svg
.
selectAll
(
selectorTarget
(
id
))
.
transition
()
.
style
(
'opacity'
,
0
)
.
remove
();
if
(
__legend_show
)
{
legend
.
selectAll
(
'.'
+
CLASS
.
legendItem
+
getTargetSelectorSuffix
(
id
)).
remove
();
}
});
}
/*-- Draw Legend --*/
function
toggleFocusLegend
(
id
,
focus
)
{
...
...
@@ -3685,19 +3700,10 @@
}
};
c3
.
unload
=
function
(
targetId
)
{
c3
.
data
.
targets
=
c3
.
data
.
targets
.
filter
(
function
(
t
)
{
return
t
.
id
!==
targetId
;
});
svg
.
selectAll
(
selectorTarget
(
targetId
))
.
transition
()
.
style
(
'opacity'
,
0
)
.
remove
();
if
(
__legend_show
)
{
legend
.
selectAll
(
'.'
+
CLASS
.
legendItem
+
getTargetSelectorSuffix
(
targetId
)).
remove
();
}
c3
.
unload
=
function
(
targetIds
)
{
// remove elements for targetId
unload
(
typeof
targetIds
===
'string'
?
[
targetIds
]
:
targetIds
);
// try redraw if targets exist
if
(
c3
.
data
.
targets
.
length
>
0
)
{
redraw
({
withUpdateOrgXDomain
:
true
,
withUpdateXDomain
:
true
,
withLegend
:
true
});
}
...
...
c3.min.js
View file @
e8b7f734
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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