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
6b276cd7
Commit
6b276cd7
authored
May 28, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Plain Diff
Fix conflict
parents
fc658310
6ba6ce89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
c3.js
c3.js
+9
-2
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
6b276cd7
...
...
@@ -249,6 +249,7 @@
// pie
var
__pie_label_show
=
getConfig
([
'pie'
,
'label'
,
'show'
],
true
),
__pie_label_format
=
getConfig
([
'pie'
,
'label'
,
'format'
]),
__pie_label_threshold
=
getConfig
([
'pie'
,
'label'
,
'threshold'
],
0.05
),
__pie_expand
=
getConfig
([
'pie'
,
'expand'
],
true
),
__pie_onclick
=
getConfig
([
'pie'
,
'onclick'
],
function
()
{}),
__pie_onmouseover
=
getConfig
([
'pie'
,
'onmouseover'
],
function
()
{}),
...
...
@@ -268,6 +269,7 @@
// donut
var
__donut_label_show
=
getConfig
([
'donut'
,
'label'
,
'show'
],
true
),
__donut_label_format
=
getConfig
([
'donut'
,
'label'
,
'format'
]),
__donut_label_threshold
=
getConfig
([
'donut'
,
'label'
,
'threshold'
],
0.05
),
__donut_expand
=
getConfig
([
'donut'
,
'expand'
],
true
),
__donut_title
=
getConfig
([
'donut'
,
'title'
],
""
),
__donut_onclick
=
getConfig
([
'donut'
,
'onclick'
],
function
()
{}),
...
...
@@ -1044,10 +1046,11 @@
}
function
textForArcLabel
(
d
)
{
var
updated
,
value
,
ratio
,
format
;
if
(
!
shouldShowArcLab
le
())
{
return
""
;
}
if
(
!
shouldShowArcLab
el
())
{
return
""
;
}
updated
=
updateAngle
(
d
);
value
=
updated
?
updated
.
value
:
null
;
ratio
=
getArcRatio
(
updated
);
if
(
!
meetsArcLabelThreshold
(
ratio
))
{
return
""
;
}
format
=
getArcLabelFormat
();
return
format
?
format
(
value
,
ratio
)
:
defaultArcValueFormat
(
value
,
ratio
);
}
...
...
@@ -1080,7 +1083,7 @@
svg
.
selectAll
(
'.'
+
CLASS
.
arc
)
.
style
(
"opacity"
,
1
);
}
function
shouldShowArcLab
le
()
{
function
shouldShowArcLab
el
()
{
var
shouldShow
=
true
;
if
(
hasDonutType
(
c3
.
data
.
targets
))
{
shouldShow
=
__donut_label_show
;
...
...
@@ -1090,6 +1093,10 @@
// when gauge, always true
return
shouldShow
;
}
function
meetsArcLabelThreshold
(
ratio
)
{
var
threshold
=
hasDonutType
(
c3
.
data
.
targets
)
?
__donut_label_threshold
:
__pie_label_threshold
;
return
ratio
>=
threshold
;
}
function
getArcLabelFormat
()
{
var
format
=
__pie_label_format
;
if
(
hasGaugeType
(
c3
.
data
.
targets
))
{
...
...
c3.min.js
View file @
6b276cd7
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