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
160d8bd5
Commit
160d8bd5
authored
May 09, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify region.remove API
parent
b5cc74f9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
12 deletions
+23
-12
c3.js
c3.js
+15
-12
c3.min.js
c3.min.js
+0
-0
regions.html
htdocs/samples/regions.html
+8
-0
No files found.
c3.js
View file @
160d8bd5
...
...
@@ -4353,19 +4353,22 @@
redraw
();
return
__regions
;
};
c3
.
regions
.
remove
=
function
(
classes
,
options
)
{
var
regionClasses
=
[].
concat
(
classes
);
options
=
isDefined
(
options
)
?
options
:
{};
regionClasses
.
forEach
(
function
(
cls
)
{
var
duration
=
isValue
(
options
.
duration
)
?
options
.
duration
:
0
;
svg
.
selectAll
(
'.'
+
cls
)
.
transition
().
duration
(
duration
)
.
style
(
'fill-opacity'
,
0
)
.
remove
();
__regions
=
__regions
.
filter
(
function
(
region
)
{
return
region
.
classes
.
indexOf
(
cls
)
<
0
;
});
c3
.
regions
.
remove
=
function
(
options
)
{
var
duration
,
classes
,
regions
;
options
=
options
||
{};
duration
=
getOption
(
options
,
"duration"
,
__transition_duration
);
classes
=
getOption
(
options
,
"classes"
,
[
CLASS
.
region
]);
regions
=
main
.
select
(
'.'
+
CLASS
.
regions
).
selectAll
(
classes
.
map
(
function
(
c
)
{
return
'.'
+
c
;
}));
(
duration
?
regions
.
transition
().
duration
(
duration
)
:
regions
)
.
style
(
'opacity'
,
0
)
.
remove
();
__regions
=
__regions
.
filter
(
function
(
region
)
{
return
classes
.
indexOf
(
region
.
class
)
<
0
;
});
return
__regions
;
};
...
...
c3.min.js
View file @
160d8bd5
This diff is collapsed.
Click to expand it.
htdocs/samples/regions.html
View file @
160d8bd5
...
...
@@ -53,6 +53,14 @@
chart
.
regions
.
add
([{
start
:
4.5
}]);
},
4000
);
setTimeout
(
function
()
{
chart
.
regions
.
add
([{
start
:
3
,
end
:
3.5
,
class
:
"region1"
},
{
start
:
4
,
end
:
4.5
,
class
:
"region2"
}]);
},
4000
);
setTimeout
(
function
()
{
chart
.
regions
.
remove
({
classes
:[
'region1'
,
'region2'
],
duration
:
0
});
},
5000
);
</script>
</body>
...
...
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