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
594f7514
Commit
594f7514
authored
Jul 21, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tick turning for 90 degrees in debug mode
parent
d049e52c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
16 deletions
+38
-16
c3.js
c3.js
+21
-8
c3.min.js
c3.min.js
+0
-0
c3.axis.js
src/c3.axis.js
+17
-8
No files found.
c3.js
View file @
594f7514
...
@@ -8289,7 +8289,11 @@
...
@@ -8289,7 +8289,11 @@
}
}
if
(
!
shouldSplitText
){
if
(
!
shouldSplitText
){
return
[
tickText
.
substr
(
0
,
10
)];
var
postfix
=
''
;
if
(
tickText
.
length
>
12
){
//postfix = '...';
}
return
[
tickText
.
substr
(
0
,
10
)
+
postfix
];
}
}
if
(
$$
.
isXAxis
(
orient
)){
if
(
$$
.
isXAxis
(
orient
)){
...
@@ -8351,18 +8355,27 @@
...
@@ -8351,18 +8355,27 @@
text
=
tick
.
select
(
"text"
);
text
=
tick
.
select
(
"text"
);
if
(
typeof
turn_axis_ticks
!==
'undefined'
){
if
(
typeof
turn_axis_ticks
!==
'undefined'
||
typeof
turn_axis_ticks_90
!==
'undefined'
){
if
(
$$
.
isXAxis
(
orient
)){
if
(
$$
.
isXAxis
(
orient
)
&&
$$
.
isCategorized
){
if
(
$$
.
isCategorized
()){
shouldSplitText
=
false
;
shouldSplitText
=
false
;
if
(
typeof
turn_axis_ticks
!==
'undefined'
){
text
.
attr
(
'transform'
,
function
(
d
,
i
){
text
.
attr
(
'transform'
,
function
(
d
,
i
){
var
tickText
=
splitTickText
(
d
)[
0
];
var
tickText
=
splitTickText
(
d
)[
0
];
var
offset
=
15
;
var
offset
=
7
;
var
tickSize
=
getSizeFor1Char
(
tickText
).
w
*
tickText
.
length
;
return
'rotate(-45) translate('
+
(
-
tickSize
/
2
-
offset
)
+
', '
+
(
-
tickOffset
/
Math
.
sqrt
(
2
)
/
2
)
+
')'
;
});
}
else
{
text
.
attr
(
'transform'
,
function
(
d
){
var
tickText
=
splitTickText
(
d
)[
0
];
var
offset
=
10
;
var
tickSize
=
getSizeFor1Char
(
tickText
).
w
*
tickText
.
length
+
offset
;
var
tickSize
=
getSizeFor1Char
(
tickText
).
w
*
tickText
.
length
;
return
'rotate(-
45) translate('
+
(
-
tickSize
/
2
)
+
', '
+
(
-
tickOffset
/
Math
.
sqrt
(
2
)
/
2
)
+
')'
;
return
'rotate(-
90) translate('
+
(
-
tickSize
/
2
-
offset
)
+
', '
+
(
-
tickOffset
)
+
')'
;
});
});
}
}
}
}
...
...
c3.min.js
View file @
594f7514
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/c3.axis.js
View file @
594f7514
...
@@ -161,7 +161,7 @@ function c3_axis(d3, params, $$) {
...
@@ -161,7 +161,7 @@ function c3_axis(d3, params, $$) {
if
(
!
shouldSplitText
){
if
(
!
shouldSplitText
){
var
postfix
=
''
;
var
postfix
=
''
;
if
(
tickText
.
length
>
12
){
if
(
tickText
.
length
>
12
){
postfix
=
'...'
;
//
postfix = '...';
}
}
return
[
tickText
.
substr
(
0
,
10
)
+
postfix
];
return
[
tickText
.
substr
(
0
,
10
)
+
postfix
];
}
}
...
@@ -225,18 +225,27 @@ function c3_axis(d3, params, $$) {
...
@@ -225,18 +225,27 @@ function c3_axis(d3, params, $$) {
text
=
tick
.
select
(
"text"
);
text
=
tick
.
select
(
"text"
);
if
(
typeof
turn_axis_ticks
!==
'undefined'
){
if
(
typeof
turn_axis_ticks
!==
'undefined'
||
typeof
turn_axis_ticks_90
!==
'undefined'
){
if
(
$$
.
isXAxis
(
orient
)){
if
(
$$
.
isXAxis
(
orient
)
&&
$$
.
isCategorized
){
if
(
$$
.
isCategorized
()){
shouldSplitText
=
false
;
shouldSplitText
=
false
;
if
(
typeof
turn_axis_ticks
!==
'undefined'
){
text
.
attr
(
'transform'
,
function
(
d
,
i
){
text
.
attr
(
'transform'
,
function
(
d
,
i
){
var
tickText
=
splitTickText
(
d
)[
0
];
var
tickText
=
splitTickText
(
d
)[
0
];
var
offset
=
15
;
var
offset
=
7
;
var
tickSize
=
getSizeFor1Char
(
tickText
).
w
*
tickText
.
length
;
return
'rotate(-45) translate('
+
(
-
tickSize
/
2
-
offset
)
+
', '
+
(
-
tickOffset
/
Math
.
sqrt
(
2
)
/
2
)
+
')'
;
});
}
else
{
text
.
attr
(
'transform'
,
function
(
d
){
var
tickText
=
splitTickText
(
d
)[
0
];
var
offset
=
10
;
var
tickSize
=
getSizeFor1Char
(
tickText
).
w
*
tickText
.
length
+
offset
;
var
tickSize
=
getSizeFor1Char
(
tickText
).
w
*
tickText
.
length
;
return
'rotate(-
45) translate('
+
(
-
tickSize
/
2
)
+
', '
+
(
-
tickOffset
/
Math
.
sqrt
(
2
)
/
2
)
+
')'
;
return
'rotate(-
90) translate('
+
(
-
tickSize
/
2
-
offset
)
+
', '
+
(
-
tickOffset
)
+
')'
;
});
});
}
}
}
}
...
...
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