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
Evgeny
c3-closed
Commits
4c6e2a99
Commit
4c6e2a99
authored
Jun 02, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept multiple args in xgrids/ygrids.remove API
parent
c81f5a29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
7 deletions
+25
-7
c3.js
c3.js
+12
-7
c3.min.js
c3.min.js
+0
-0
grid_x_lines.html
htdocs/samples/grid_x_lines.html
+13
-0
No files found.
c3.js
View file @
4c6e2a99
...
...
@@ -4655,15 +4655,20 @@
function
isArc
(
d
)
{
return
'data'
in
d
&&
hasTarget
(
c3
.
data
.
targets
,
d
.
data
.
id
);
}
function
getGridFilter
(
params
)
{
params
=
params
||
{};
return
function
(
line
)
{
return
!
((
'value'
in
params
&&
line
.
value
===
params
.
value
)
||
(
'class'
in
params
&&
line
.
class
===
params
.
class
));
};
function
getGridFilterToRemove
(
params
)
{
return
params
?
function
(
line
)
{
var
found
=
false
;
[].
concat
(
params
).
forEach
(
function
(
param
)
{
if
(((
'value'
in
param
&&
line
.
value
===
params
.
value
)
||
(
'class'
in
param
&&
line
.
class
===
params
.
class
)))
{
found
=
true
;
}
});
return
found
;
}
:
function
()
{
return
true
;
};
}
function
removeGridLines
(
params
,
forX
)
{
var
to
Show
=
getGridFilter
(
params
),
to
Remove
=
function
(
line
)
{
return
!
toShow
(
line
);
},
var
to
Remove
=
getGridFilterToRemove
(
params
),
to
Show
=
function
(
line
)
{
return
!
toRemove
(
line
);
},
classLines
=
forX
?
CLASS
.
xgridLines
:
CLASS
.
ygridLines
,
classLine
=
forX
?
CLASS
.
xgridLine
:
CLASS
.
ygridLine
;
main
.
select
(
'.'
+
classLines
).
selectAll
(
'.'
+
classLine
).
filter
(
toRemove
)
...
...
c3.min.js
View file @
4c6e2a99
This diff is collapsed.
Click to expand it.
htdocs/samples/grid_x_lines.html
View file @
4c6e2a99
...
...
@@ -44,6 +44,19 @@
setTimeout
(
function
()
{
chart
.
xgrids
.
remove
({
class
:
'hoge'
});
},
5000
);
setTimeout
(
function
()
{
chart
.
xgrids
.
remove
([{
value
:
1
},
{
value
:
4
}]);
},
6000
);
setTimeout
(
function
()
{
chart
.
xgrids
([{
value
:
1
,
text
:
'Label 1'
},
{
value
:
4
,
text
:
'Label 4'
}]);
},
7000
);
setTimeout
(
function
()
{
chart
.
xgrids
.
remove
();
},
8000
);
</script>
</body>
</html>
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