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
f9ad16a4
Commit
f9ad16a4
authored
Jun 06, 2015
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1188 from j-white/features/hide-from-legend-and-tooltip
Add the ability to prevent elements from the showing up in legend and tool-tip
parents
f6add829
761269ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
data.js
src/data.js
+1
-1
legend.js
src/legend.js
+3
-0
tooltip.js
src/tooltip.js
+2
-0
No files found.
src/data.js
View file @
f9ad16a4
...
...
@@ -53,7 +53,7 @@ c3_chart_internal_fn.addName = function (data) {
var
$$
=
this
,
name
;
if
(
data
)
{
name
=
$$
.
config
.
data_names
[
data
.
id
];
data
.
name
=
name
?
name
:
data
.
id
;
data
.
name
=
name
!==
undefined
?
name
:
data
.
id
;
}
return
data
;
};
...
...
src/legend.js
View file @
f9ad16a4
...
...
@@ -119,6 +119,9 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
var
withTransition
,
withTransitionForTransform
;
var
texts
,
rects
,
tiles
,
background
;
// Skip elements when their name is set to null
targetIds
=
targetIds
.
filter
(
function
(
id
)
{
return
!
isDefined
(
config
.
data_names
[
id
])
||
config
.
data_names
[
id
]
!==
null
;});
options
=
options
||
{};
withTransition
=
getOption
(
options
,
"withTransition"
,
true
);
withTransitionForTransform
=
getOption
(
options
,
"withTransitionForTransform"
,
true
);
...
...
src/tooltip.js
View file @
f9ad16a4
...
...
@@ -40,6 +40,8 @@ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaul
value
=
valueFormat
(
d
[
i
].
value
,
d
[
i
].
ratio
,
d
[
i
].
id
,
d
[
i
].
index
);
if
(
value
!==
undefined
)
{
// Skip elements when their name is set to null
if
(
d
[
i
].
name
===
null
)
{
continue
;
}
name
=
nameFormat
(
d
[
i
].
name
,
d
[
i
].
ratio
,
d
[
i
].
id
,
d
[
i
].
index
);
bgcolor
=
$$
.
levelColor
?
$$
.
levelColor
(
d
[
i
].
value
)
:
color
(
d
[
i
].
id
);
...
...
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