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
2d6fbdba
Commit
2d6fbdba
authored
May 04, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add padding.top/bottom and fix transition of axis label - #193
parent
85a57161
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
15 deletions
+17
-15
c3.js
c3.js
+17
-15
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
2d6fbdba
...
@@ -110,7 +110,9 @@
...
@@ -110,7 +110,9 @@
__size_height
=
getConfig
([
'size'
,
'height'
]);
__size_height
=
getConfig
([
'size'
,
'height'
]);
var
__padding_left
=
getConfig
([
'padding'
,
'left'
],
50
),
var
__padding_left
=
getConfig
([
'padding'
,
'left'
],
50
),
__padding_right
=
getConfig
([
'padding'
,
'right'
]);
__padding_right
=
getConfig
([
'padding'
,
'right'
],
0
),
__padding_top
=
getConfig
([
'padding'
,
'top'
],
0
),
__padding_bottom
=
getConfig
([
'padding'
,
'bottom'
],
0
);
var
__zoom_enabled
=
getConfig
([
'zoom'
,
'enabled'
],
false
),
var
__zoom_enabled
=
getConfig
([
'zoom'
,
'enabled'
],
false
),
__zoom_extent
=
getConfig
([
'zoom'
,
'extent'
]),
__zoom_extent
=
getConfig
([
'zoom'
,
'extent'
]),
...
@@ -416,9 +418,9 @@
...
@@ -416,9 +418,9 @@
// for main, context
// for main, context
if
(
__axis_rotated
)
{
if
(
__axis_rotated
)
{
margin
=
{
margin
=
{
top
:
getHorizontalAxisHeight
(
'y2'
),
top
:
getHorizontalAxisHeight
(
'y2'
)
+
__padding_top
,
right
:
getCurrentPaddingRight
(),
right
:
getCurrentPaddingRight
(),
bottom
:
getHorizontalAxisHeight
(
'y'
)
+
legendHeightForBottom
,
bottom
:
getHorizontalAxisHeight
(
'y'
)
+
legendHeightForBottom
+
__padding_bottom
,
left
:
subchartHeight
+
getCurrentPaddingLeft
()
left
:
subchartHeight
+
getCurrentPaddingLeft
()
};
};
margin2
=
{
margin2
=
{
...
@@ -429,9 +431,9 @@
...
@@ -429,9 +431,9 @@
};
};
}
else
{
}
else
{
margin
=
{
margin
=
{
top
:
4
,
// for top tick text
top
:
4
+
__padding_top
,
// for top tick text
right
:
getCurrentPaddingRight
(),
right
:
getCurrentPaddingRight
(),
bottom
:
xAxisHeight
+
subchartHeight
+
legendHeightForBottom
,
bottom
:
xAxisHeight
+
subchartHeight
+
legendHeightForBottom
+
__padding_bottom
,
left
:
getCurrentPaddingLeft
()
left
:
getCurrentPaddingLeft
()
};
};
margin2
=
{
margin2
=
{
...
@@ -885,22 +887,22 @@
...
@@ -885,22 +887,22 @@
});
});
return
maxWidth
<
0
?
0
:
maxWidth
;
return
maxWidth
<
0
?
0
:
maxWidth
;
}
}
function
updateAxisLabels
()
{
function
updateAxisLabels
(
withTransition
)
{
main
.
select
(
'.'
+
CLASS
.
axisX
+
' .'
+
CLASS
.
axisXLabel
)
var
axisXLabel
=
main
.
select
(
'.'
+
CLASS
.
axisX
+
' .'
+
CLASS
.
axisXLabel
),
.
transition
()
axisYLabel
=
main
.
select
(
'.'
+
CLASS
.
axisY
+
' .'
+
CLASS
.
axisYLabel
),
axisY2Label
=
main
.
select
(
'.'
+
CLASS
.
axisY2
+
' .'
+
CLASS
.
axisY2Label
);
(
withTransition
?
axisXLabel
.
transition
()
:
axisXLabel
)
.
attr
(
"x"
,
xForXAxisLabel
)
.
attr
(
"x"
,
xForXAxisLabel
)
.
attr
(
"dx"
,
dxForXAxisLabel
)
.
attr
(
"dx"
,
dxForXAxisLabel
)
.
attr
(
"dy"
,
dyForXAxisLabel
)
.
attr
(
"dy"
,
dyForXAxisLabel
)
.
text
(
textForXAxisLabel
);
.
text
(
textForXAxisLabel
);
main
.
select
(
'.'
+
CLASS
.
axisY
+
' .'
+
CLASS
.
axisYLabel
)
(
withTransition
?
axisYLabel
.
transition
()
:
axisYLabel
)
.
transition
()
.
attr
(
"x"
,
xForYAxisLabel
)
.
attr
(
"x"
,
xForYAxisLabel
)
.
attr
(
"dx"
,
dxForYAxisLabel
)
.
attr
(
"dx"
,
dxForYAxisLabel
)
.
attr
(
"dy"
,
dyForYAxisLabel
)
.
attr
(
"dy"
,
dyForYAxisLabel
)
.
attr
(
"dy"
,
dyForYAxisLabel
)
.
attr
(
"dy"
,
dyForYAxisLabel
)
.
text
(
textForYAxisLabel
);
.
text
(
textForYAxisLabel
);
main
.
select
(
'.'
+
CLASS
.
axisY2
+
' .'
+
CLASS
.
axisY2Label
)
(
withTransition
?
axisY2Label
.
transition
()
:
axisY2Label
)
.
transition
()
.
attr
(
"x"
,
xForY2AxisLabel
)
.
attr
(
"x"
,
xForY2AxisLabel
)
.
attr
(
"dx"
,
dxForY2AxisLabel
)
.
attr
(
"dx"
,
dxForY2AxisLabel
)
.
attr
(
"dy"
,
dyForY2AxisLabel
)
.
attr
(
"dy"
,
dyForY2AxisLabel
)
...
@@ -3230,6 +3232,9 @@
...
@@ -3230,6 +3232,9 @@
transitions
.
axisY2
.
call
(
y2Axis
);
transitions
.
axisY2
.
call
(
y2Axis
);
transitions
.
axisSubX
.
call
(
subXAxis
);
transitions
.
axisSubX
.
call
(
subXAxis
);
// Update axis label
updateAxisLabels
(
withTransition
);
// show/hide if manual culling needed
// show/hide if manual culling needed
if
(
withUpdateXDomain
&&
targetsToShow
.
length
)
{
if
(
withUpdateXDomain
&&
targetsToShow
.
length
)
{
if
(
__axis_x_tick_culling
&&
tickValues
)
{
if
(
__axis_x_tick_culling
&&
tickValues
)
{
...
@@ -3260,9 +3265,6 @@
...
@@ -3260,9 +3265,6 @@
xForText
=
generateXYForText
(
barIndices
,
true
);
xForText
=
generateXYForText
(
barIndices
,
true
);
yForText
=
generateXYForText
(
barIndices
,
false
);
yForText
=
generateXYForText
(
barIndices
,
false
);
// Update axis label
updateAxisLabels
();
// Update sub domain
// Update sub domain
subY
.
domain
(
y
.
domain
());
subY
.
domain
(
y
.
domain
());
subY2
.
domain
(
y2
.
domain
());
subY2
.
domain
(
y2
.
domain
());
...
...
c3.min.js
View file @
2d6fbdba
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