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
0cf1c6de
Commit
0cf1c6de
authored
Apr 14, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pie.expand and donut.expand option - #153
parent
602f3775
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
c3.js
c3.js
+19
-10
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
0cf1c6de
...
@@ -224,6 +224,7 @@
...
@@ -224,6 +224,7 @@
// pie
// pie
var
__pie_label_show
=
getConfig
([
'pie'
,
'label'
,
'show'
],
true
),
var
__pie_label_show
=
getConfig
([
'pie'
,
'label'
,
'show'
],
true
),
__pie_label_format
=
getConfig
([
'pie'
,
'label'
,
'format'
]),
__pie_label_format
=
getConfig
([
'pie'
,
'label'
,
'format'
]),
__pie_expand
=
getConfig
([
'pie'
,
'expand'
],
true
),
__pie_onclick
=
getConfig
([
'pie'
,
'onclick'
],
function
()
{}),
__pie_onclick
=
getConfig
([
'pie'
,
'onclick'
],
function
()
{}),
__pie_onmouseover
=
getConfig
([
'pie'
,
'onmouseover'
],
function
()
{}),
__pie_onmouseover
=
getConfig
([
'pie'
,
'onmouseover'
],
function
()
{}),
__pie_onmouseout
=
getConfig
([
'pie'
,
'onmouseout'
],
function
()
{});
__pie_onmouseout
=
getConfig
([
'pie'
,
'onmouseout'
],
function
()
{});
...
@@ -231,6 +232,7 @@
...
@@ -231,6 +232,7 @@
// donut
// donut
var
__donut_label_show
=
getConfig
([
'donut'
,
'label'
,
'show'
],
true
),
var
__donut_label_show
=
getConfig
([
'donut'
,
'label'
,
'show'
],
true
),
__donut_label_format
=
getConfig
([
'donut'
,
'label'
,
'format'
]),
__donut_label_format
=
getConfig
([
'donut'
,
'label'
,
'format'
]),
__donut_expand
=
getConfig
([
'donut'
,
'expand'
],
true
),
__donut_title
=
getConfig
([
'donut'
,
'title'
],
""
),
__donut_title
=
getConfig
([
'donut'
,
'title'
],
""
),
__donut_onclick
=
getConfig
([
'donut'
,
'onclick'
],
function
()
{}),
__donut_onclick
=
getConfig
([
'donut'
,
'onclick'
],
function
()
{}),
__donut_onmouseover
=
getConfig
([
'donut'
,
'onmouseover'
],
function
()
{}),
__donut_onmouseover
=
getConfig
([
'donut'
,
'onmouseover'
],
function
()
{}),
...
@@ -1047,16 +1049,19 @@
...
@@ -1047,16 +1049,19 @@
function
expandArc
(
id
,
withoutFadeOut
)
{
function
expandArc
(
id
,
withoutFadeOut
)
{
var
target
=
svg
.
selectAll
(
'.'
+
CLASS
.
chartArc
+
selectorTarget
(
id
)),
var
target
=
svg
.
selectAll
(
'.'
+
CLASS
.
chartArc
+
selectorTarget
(
id
)),
noneTargets
=
svg
.
selectAll
(
'.'
+
CLASS
.
arc
).
filter
(
function
(
data
)
{
return
data
.
data
.
id
!==
id
;
});
noneTargets
=
svg
.
selectAll
(
'.'
+
CLASS
.
arc
).
filter
(
function
(
data
)
{
return
data
.
data
.
id
!==
id
;
});
target
.
selectAll
(
'path'
)
.
transition
().
duration
(
50
)
if
(
shouldExpand
(
id
))
{
.
attr
(
"d"
,
svgArcExpanded
)
target
.
selectAll
(
'path'
)
.
transition
().
duration
(
100
)
.
transition
().
duration
(
50
)
.
attr
(
"d"
,
svgArcExpandedSub
)
.
attr
(
"d"
,
svgArcExpanded
)
.
each
(
function
(
d
)
{
.
transition
().
duration
(
100
)
if
(
isDonutType
(
d
.
data
))
{
.
attr
(
"d"
,
svgArcExpandedSub
)
// callback here
.
each
(
function
(
d
)
{
}
if
(
isDonutType
(
d
.
data
))
{
});
// callback here
}
});
}
if
(
!
withoutFadeOut
)
{
if
(
!
withoutFadeOut
)
{
noneTargets
.
style
(
"opacity"
,
0.3
);
noneTargets
.
style
(
"opacity"
,
0.3
);
}
}
...
@@ -1982,6 +1987,10 @@
...
@@ -1982,6 +1987,10 @@
return
isBarType
(
d
)
||
isLineType
(
d
)
?
d
.
values
:
[];
return
isBarType
(
d
)
||
isLineType
(
d
)
?
d
.
values
:
[];
}
}
function
shouldExpand
(
id
)
{
return
(
isDonutType
(
id
)
&&
__donut_expand
)
||
(
isPieType
(
id
)
&&
__pie_expand
);
}
//-- Color --//
//-- Color --//
function
generateColor
(
colors
,
pattern
,
callback
)
{
function
generateColor
(
colors
,
pattern
,
callback
)
{
...
...
c3.min.js
View file @
0cf1c6de
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