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
ed58b5c2
Commit
ed58b5c2
authored
Aug 18, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix x padding when turning for 90 degrees
parent
aab38839
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
c3.js
c3.js
+5
-3
c3.min.js
c3.min.js
+0
-0
axis.js
src/axis.js
+4
-2
size.js
src/size.js
+1
-1
No files found.
c3.js
View file @
ed58b5c2
...
@@ -2816,7 +2816,7 @@
...
@@ -2816,7 +2816,7 @@
if
(
axisId
===
'y2'
&&
!
config
.
axis_y2_show
)
{
return
$$
.
rotated_padding_top
;
}
if
(
axisId
===
'y2'
&&
!
config
.
axis_y2_show
)
{
return
$$
.
rotated_padding_top
;
}
// Calculate x axis height when tick rotated
// Calculate x axis height when tick rotated
if
(
axisId
===
'x'
&&
!
config
.
axis_rotated
&&
config
.
axis_x_tick_rotate
)
{
if
(
axisId
===
'x'
&&
!
config
.
axis_rotated
&&
config
.
axis_x_tick_rotate
)
{
h
=
$$
.
getMaxTickWidthAllowed
(
axisId
)
*
Math
.
cos
(
Math
.
PI
*
Math
.
abs
(
config
.
axis_x_tick_rotate
)
/
180
);
h
=
$$
.
getMaxTickWidthAllowed
(
axisId
)
*
Math
.
sin
(
Math
.
PI
*
Math
.
abs
(
config
.
axis_x_tick_rotate
)
/
180
);
}
}
return
h
+
(
$$
.
getAxisLabelPositionById
(
axisId
).
isInner
?
10
:
15
)
+
(
axisId
===
'y2'
?
-
10
:
0
);
return
h
+
(
$$
.
getAxisLabelPositionById
(
axisId
).
isInner
?
10
:
15
)
+
(
axisId
===
'y2'
?
-
10
:
0
);
};
};
...
@@ -4873,7 +4873,7 @@
...
@@ -4873,7 +4873,7 @@
var
$$
=
this
,
config
=
$$
.
config
,
var
$$
=
this
,
config
=
$$
.
config
,
position
=
$$
.
getXAxisLabelPosition
();
position
=
$$
.
getXAxisLabelPosition
();
if
(
config
.
axis_rotated
)
{
if
(
config
.
axis_rotated
)
{
return
position
.
isInner
?
"1.2em"
:
-
2
5
-
$$
.
getMaxTickWidth
(
'x'
);
return
position
.
isInner
?
"1.2em"
:
-
1
5
-
$$
.
getMaxTickWidth
(
'x'
);
}
else
{
}
else
{
if
(
position
.
isInner
){
if
(
position
.
isInner
){
return
"-0.5em"
;
return
"-0.5em"
;
...
@@ -4884,7 +4884,9 @@
...
@@ -4884,7 +4884,9 @@
}
}
if
(
config
.
axis_x_tick_rotate
!==
0
){
if
(
config
.
axis_x_tick_rotate
!==
0
){
return
$$
.
getMaxTickWidth
(
'x'
);
var
coef
=
$$
.
getCurrentHeight
()
/
12
;
var
v
=
$$
.
getMaxTickWidth
(
'x'
)
*
Math
.
sin
(
Math
.
abs
(
Math
.
PI
*
config
.
axis_x_tick_rotate
/
180
))
+
coef
;
return
v
;
}
}
return
35
;
return
35
;
...
...
c3.min.js
View file @
ed58b5c2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/axis.js
View file @
ed58b5c2
...
@@ -251,7 +251,7 @@ c3_chart_internal_fn.dyForXAxisLabel = function () {
...
@@ -251,7 +251,7 @@ c3_chart_internal_fn.dyForXAxisLabel = function () {
var
$$
=
this
,
config
=
$$
.
config
,
var
$$
=
this
,
config
=
$$
.
config
,
position
=
$$
.
getXAxisLabelPosition
();
position
=
$$
.
getXAxisLabelPosition
();
if
(
config
.
axis_rotated
)
{
if
(
config
.
axis_rotated
)
{
return
position
.
isInner
?
"1.2em"
:
-
2
5
-
$$
.
getMaxTickWidth
(
'x'
);
return
position
.
isInner
?
"1.2em"
:
-
1
5
-
$$
.
getMaxTickWidth
(
'x'
);
}
else
{
}
else
{
if
(
position
.
isInner
){
if
(
position
.
isInner
){
return
"-0.5em"
;
return
"-0.5em"
;
...
@@ -262,7 +262,9 @@ c3_chart_internal_fn.dyForXAxisLabel = function () {
...
@@ -262,7 +262,9 @@ c3_chart_internal_fn.dyForXAxisLabel = function () {
}
}
if
(
config
.
axis_x_tick_rotate
!==
0
){
if
(
config
.
axis_x_tick_rotate
!==
0
){
return
$$
.
getMaxTickWidth
(
'x'
);
var
coef
=
$$
.
getCurrentHeight
()
/
12
;
var
v
=
$$
.
getMaxTickWidth
(
'x'
)
*
Math
.
sin
(
Math
.
abs
(
Math
.
PI
*
config
.
axis_x_tick_rotate
/
180
))
+
coef
;
return
v
;
}
}
return
35
;
return
35
;
...
...
src/size.js
View file @
ed58b5c2
...
@@ -86,7 +86,7 @@ c3_chart_internal_fn.getHorizontalAxisHeight = function (axisId) {
...
@@ -86,7 +86,7 @@ c3_chart_internal_fn.getHorizontalAxisHeight = function (axisId) {
if
(
axisId
===
'y2'
&&
!
config
.
axis_y2_show
)
{
return
$$
.
rotated_padding_top
;
}
if
(
axisId
===
'y2'
&&
!
config
.
axis_y2_show
)
{
return
$$
.
rotated_padding_top
;
}
// Calculate x axis height when tick rotated
// Calculate x axis height when tick rotated
if
(
axisId
===
'x'
&&
!
config
.
axis_rotated
&&
config
.
axis_x_tick_rotate
)
{
if
(
axisId
===
'x'
&&
!
config
.
axis_rotated
&&
config
.
axis_x_tick_rotate
)
{
h
=
$$
.
getMaxTickWidthAllowed
(
axisId
)
*
Math
.
cos
(
Math
.
PI
*
Math
.
abs
(
config
.
axis_x_tick_rotate
)
/
180
);
h
=
$$
.
getMaxTickWidthAllowed
(
axisId
)
*
Math
.
sin
(
Math
.
PI
*
Math
.
abs
(
config
.
axis_x_tick_rotate
)
/
180
);
}
}
return
h
+
(
$$
.
getAxisLabelPositionById
(
axisId
).
isInner
?
10
:
15
)
+
(
axisId
===
'y2'
?
-
10
:
0
);
return
h
+
(
$$
.
getAxisLabelPositionById
(
axisId
).
isInner
?
10
:
15
)
+
(
axisId
===
'y2'
?
-
10
:
0
);
};
};
...
...
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