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
4a6304c4
Commit
4a6304c4
authored
Feb 20, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add arc.label.format option
parent
c91efd94
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
c3.js
c3.js
+4
-1
c3.min.js
c3.min.js
+0
-0
dount.html
htdocs/samples/dount.html
+6
-0
No files found.
c3.js
View file @
4a6304c4
...
...
@@ -122,6 +122,9 @@
__point_onselected
=
getConfig
([
'point'
,
'onselected'
],
function
()
{}),
__point_onunselected
=
getConfig
([
'point'
,
'onunselected'
],
function
()
{});
// arc
var
__arc_label_fomat
=
getConfig
([
'arc'
,
'label'
,
'format'
],
function
(
d
,
ratio
)
{
return
ratio
.
toFixed
(
1
)
+
"%"
;
});
// region - region to change style
var
__regions
=
getConfig
([
'regions'
],
[]);
...
...
@@ -441,7 +444,7 @@
}
function
textForArcLable
(
d
)
{
var
ratio
=
100
*
(
d
.
endAngle
-
d
.
startAngle
)
/
(
Math
.
PI
*
2
);
return
ratio
.
toFixed
(
1
)
+
"%"
;
return
__arc_label_fomat
(
d
,
ratio
)
;
}
function
expandArc
(
targetId
,
withoutFadeOut
)
{
var
target
=
svg
.
selectAll
(
'.chart-arc.target'
+
(
targetId
?
'-'
+
targetId
:
''
)),
...
...
c3.min.js
View file @
4a6304c4
This diff is collapsed.
Click to expand it.
htdocs/samples/dount.html
View file @
4a6304c4
...
...
@@ -26,6 +26,7 @@
// ["versicolor", 40],
// ["virginica", 50],
],
// type : 'pie',
type
:
'dount'
,
},
axis
:
{
...
...
@@ -35,6 +36,11 @@
y
:
{
label
:
'Petal.Width'
}
},
arc
:
{
label
:
{
format
:
function
(
d
,
ratio
)
{
return
""
;
}
}
}
});
...
...
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