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
0b2f76c6
Commit
0b2f76c6
authored
Mar 19, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix axis label position logic
parent
53c63cfc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
c3.js
c3.js
+4
-13
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
0b2f76c6
...
...
@@ -268,7 +268,7 @@
margin
=
{
top
:
__axis_rotated
&&
__axis_y2_show
?
getAxisHeightByAxisId
(
'y2'
)
:
0
,
right
:
getCurrentPaddingRight
(),
bottom
:
getAxisHeightByAxisId
(
__axis_rotated
?
'y'
:
'x'
)
+
(
__axis_rotated
?
0
:
__subchart_size_height
)
+
getLegendPaddingTop
()
+
(
isLegendRight
?
0
:
legendHeight
),
bottom
:
getAxisHeightByAxisId
(
__axis_rotated
?
'y'
:
'x'
)
+
(
__axis_rotated
?
0
:
__subchart_size_height
)
+
(
isLegendRight
?
0
:
legendHeight
),
left
:
(
__axis_rotated
?
__subchart_size_height
+
rotated_padding_right
:
0
)
+
getCurrentPaddingLeft
()
};
width
=
currentWidth
-
margin
.
left
-
margin
.
right
;
...
...
@@ -343,10 +343,8 @@
return
position
.
isInner
?
20
+
getMaxTickWidth
(
id
)
:
40
+
getMaxTickWidth
(
id
);
}
function
getAxisHeightByAxisId
(
id
)
{
var
position
;
if
(
!
getAxisLabel
(
id
))
{
return
20
;
}
position
=
getAxisLabelPositionById
(
id
);
return
(
position
.
isInner
?
0
:
20
)
+
(
id
===
'y2'
?
20
:
0
);
var
position
=
getAxisLabelPositionById
(
id
);
return
(
position
.
isInner
?
30
:
40
)
+
(
id
===
'y2'
?
-
10
:
0
);
}
function
getParentWidth
()
{
return
+
d3
.
select
(
__bindto
).
style
(
"width"
).
replace
(
'px'
,
''
);
// TODO: if rotated, use height
...
...
@@ -411,10 +409,6 @@
function
getLegendHeight
()
{
return
__legend_show
?
isLegendRight
?
currentHeight
:
legendItemHeight
*
(
legendStep
+
1
)
:
0
;
}
function
getLegendPaddingTop
()
{
var
xAxisLabelPositon
=
getXAxisLabelPosition
();
return
xAxisLabelPositon
.
isInner
?
5
:
20
;
}
//-- Scales --//
...
...
@@ -541,9 +535,6 @@
function
getAxisLabelText
(
option
)
{
return
typeof
option
===
'string'
?
option
:
option
?
option
.
text
:
null
;
}
function
getAxisLabel
(
id
)
{
return
id
===
'x'
?
__axis_x_label
:
id
===
'y'
?
__axis_y_label
:
__axis_y2_label
;
}
function
getAxisLabelPosition
(
option
,
defaultPosition
)
{
var
position
=
(
option
&&
typeof
option
===
'object'
&&
option
.
position
)
?
option
.
position
:
defaultPosition
;
return
{
...
...
@@ -633,7 +624,7 @@
function
dyForY2AxisLabel
()
{
var
position
=
getY2AxisLabelPosition
();
if
(
__axis_rotated
)
{
return
position
.
isInner
?
"1.2em"
:
"-2.
5
em"
;
return
position
.
isInner
?
"1.2em"
:
"-2.
2
em"
;
}
else
{
return
position
.
isInner
?
"-0.5em"
:
30
+
getMaxTickWidth
(
'y2'
);
}
...
...
c3.min.js
View file @
0b2f76c6
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