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
11275488
Commit
11275488
authored
Jul 13, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix category axis
parent
3c5f1452
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
c3.js
c3.js
+10
-3
c3.min.js
c3.min.js
+0
-0
c3.axis.js
src/c3.axis.js
+10
-3
No files found.
c3.js
View file @
11275488
...
...
@@ -8253,9 +8253,16 @@
// this should be called only when category axis
function
splitTickText
(
d
,
maxWidth
)
{
var
tickText
=
textFormatted
(
d
)
,
var
tickText
,
subtext
,
spaceIndex
,
textWidth
,
thinOutCoef
,
splitted
=
[];
if
(
$$
.
isCategorized
()){
tickText
=
$$
.
categoryName
(
d
);
tickText
=
textFormatted
(
tickText
);
}
else
{
tickText
=
textFormatted
(
d
);
}
if
(
$$
.
isXAxis
(
orient
)){
thinOutCoef
=
$$
.
getXThinOutCoef
();
}
else
{
...
...
@@ -8282,7 +8289,7 @@
}
subtext
=
text
.
substr
(
0
,
i
+
1
);
textWidth
=
sizeFor1Char
.
w
*
subtext
.
length
;
// if text width gets over tick width, split by space index or crrent index
// if text width gets over tick width, split by space index or c
u
rrent index
if
(
maxWidth
<
textWidth
)
{
return
split
(
splitted
.
concat
(
text
.
substr
(
0
,
spaceIndex
?
spaceIndex
:
i
)),
...
...
@@ -8357,7 +8364,7 @@
var
coef
=
$$
.
getYThinOutCoef
();
line
.
style
(
'display'
,
function
(
d
,
i
){
return
(
i
-
indexOfZero
)
%
coef
==
0
?
'
block'
:
'none
'
;
return
(
i
-
indexOfZero
)
%
coef
==
0
?
'
none'
:
'block
'
;
});
}
}
...
...
c3.min.js
View file @
11275488
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/c3.axis.js
View file @
11275488
...
...
@@ -148,9 +148,16 @@ function c3_axis(d3, params, $$) {
// this should be called only when category axis
function
splitTickText
(
d
,
maxWidth
)
{
var
tickText
=
textFormatted
(
d
)
,
var
tickText
,
subtext
,
spaceIndex
,
textWidth
,
thinOutCoef
,
splitted
=
[];
if
(
$$
.
isCategorized
()){
tickText
=
$$
.
categoryName
(
d
);
tickText
=
textFormatted
(
tickText
);
}
else
{
tickText
=
textFormatted
(
d
);
}
if
(
$$
.
isXAxis
(
orient
)){
thinOutCoef
=
$$
.
getXThinOutCoef
();
}
else
{
...
...
@@ -177,7 +184,7 @@ function c3_axis(d3, params, $$) {
}
subtext
=
text
.
substr
(
0
,
i
+
1
);
textWidth
=
sizeFor1Char
.
w
*
subtext
.
length
;
// if text width gets over tick width, split by space index or crrent index
// if text width gets over tick width, split by space index or c
u
rrent index
if
(
maxWidth
<
textWidth
)
{
return
split
(
splitted
.
concat
(
text
.
substr
(
0
,
spaceIndex
?
spaceIndex
:
i
)),
...
...
@@ -252,7 +259,7 @@ function c3_axis(d3, params, $$) {
var
coef
=
$$
.
getYThinOutCoef
();
line
.
style
(
'display'
,
function
(
d
,
i
){
return
(
i
-
indexOfZero
)
%
coef
==
0
?
'
block'
:
'none
'
;
return
(
i
-
indexOfZero
)
%
coef
==
0
?
'
none'
:
'block
'
;
});
}
}
...
...
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