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
65197230
Commit
65197230
authored
Aug 19, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug with wrong axis label positioning
parent
7ba10e29
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
24 deletions
+30
-24
c3.js
c3.js
+15
-12
c3.min.js
c3.min.js
+0
-0
axis.js
src/axis.js
+10
-11
core.js
src/core.js
+5
-1
No files found.
c3.js
View file @
65197230
...
...
@@ -759,6 +759,7 @@
if
(
flow
)
{
flow
();
}
if
(
config
.
onrendered
)
{
config
.
onrendered
.
call
(
$$
);
}
...
...
@@ -769,6 +770,7 @@
$$
.
redrawLine
(
drawLine
);
$$
.
redrawArea
(
drawArea
);
$$
.
redrawCircle
(
cx
,
cy
);
if
(
config
.
onrendered
)
{
config
.
onrendered
.
call
(
$$
);
}
...
...
@@ -796,7 +798,7 @@
false
;
// MEMO: this needs to be called before updateLegend and it means this ALWAYS needs to be called)
$$
.
updateSizes
();
transitions
=
$$
.
generateAxisTransitions
(
options
.
withTransitionForAxis
?
config
.
transition_duration
:
0
);
transitions
=
$$
.
generateAxisTransitions
(
0
);
// MEMO: called in updateLegend in redraw if withLegend
if
(
!
(
options
.
withLegend
&&
config
.
legend_show
))
{
...
...
@@ -809,9 +811,11 @@
$$
.
redrawAxis
(
transitions
);
// MEMO: Draw with new sizes & scales
$$
.
updateSizes
();
$$
.
updateScales
();
$$
.
updateSvgSize
();
$$
.
redraw
(
options
,
transitions
);
};
c3_chart_internal_fn
.
redrawWithoutRescale
=
function
()
{
this
.
redraw
({
...
...
@@ -4806,6 +4810,7 @@
c3_chart_internal_fn
.
getAxisLabelPosition
=
function
(
axisId
,
defaultPosition
)
{
var
option
=
this
.
getAxisLabelOptionByAxisId
(
axisId
),
position
=
(
option
&&
typeof
option
===
'object'
&&
option
.
position
)
?
option
.
position
:
defaultPosition
;
return
{
isInner
:
position
.
indexOf
(
'inner'
)
>=
0
,
isOuter
:
position
.
indexOf
(
'outer'
)
>=
0
,
...
...
@@ -4861,10 +4866,12 @@
}
};
c3_chart_internal_fn
.
xForXAxisLabel
=
function
()
{
return
this
.
xForAxisLabel
(
!
this
.
config
.
axis_rotated
,
this
.
getXAxisLabelPosition
());
var
x
=
this
.
xForAxisLabel
(
!
this
.
config
.
axis_rotated
,
this
.
getXAxisLabelPosition
());
return
x
;
};
c3_chart_internal_fn
.
xForYAxisLabel
=
function
()
{
return
this
.
xForAxisLabel
(
this
.
config
.
axis_rotated
,
this
.
getYAxisLabelPosition
());
var
x
=
this
.
xForAxisLabel
(
this
.
config
.
axis_rotated
,
this
.
getYAxisLabelPosition
());
return
x
;
};
c3_chart_internal_fn
.
xForY2AxisLabel
=
function
()
{
return
this
.
xForAxisLabel
(
this
.
config
.
axis_rotated
,
this
.
getY2AxisLabelPosition
());
...
...
@@ -4995,18 +5002,15 @@
axisYLabel
=
$$
.
main
.
select
(
'.'
+
CLASS
.
axisY
+
' .'
+
CLASS
.
axisYLabel
),
axisY2Label
=
$$
.
main
.
select
(
'.'
+
CLASS
.
axisY2
+
' .'
+
CLASS
.
axisY2Label
);
var
duration
=
$$
.
config
.
transition_duration
;
(
withTransition
?
axisXLabel
.
transition
().
duration
(
duration
)
:
axisXLabel
)
.
attr
(
"x"
,
$$
.
xForXAxisLabel
.
bind
(
$$
))
axisXLabel
.
attr
(
"x"
,
$$
.
xForXAxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForXAxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForXAxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForXAxisLabel
.
bind
(
$$
));
(
withTransition
?
axisYLabel
.
transition
().
duration
(
duration
)
:
axisYLabel
)
.
attr
(
"x"
,
$$
.
xForYAxisLabel
.
bind
(
$$
))
axisYLabel
.
attr
(
"x"
,
$$
.
xForYAxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForYAxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForYAxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForYAxisLabel
.
bind
(
$$
));
(
withTransition
?
axisY2Label
.
transition
().
duration
(
duration
)
:
axisY2Label
)
.
attr
(
"x"
,
$$
.
xForY2AxisLabel
.
bind
(
$$
))
axisY2Label
.
attr
(
"x"
,
$$
.
xForY2AxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForY2AxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForY2AxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForY2AxisLabel
.
bind
(
$$
));
...
...
@@ -5082,9 +5086,8 @@
$$
.
rotateTickText
(
$$
.
axes
.
subx
,
transitions
.
axisSubX
,
config
.
axis_x_tick_rotate
);
}
//$$.updateSizes();
//$$.updateScales();
//$$.updateSvgSize();
$$
.
updateAxisLabels
();
};
c3_chart_internal_fn
.
tuneAxisTicks
=
function
(){
...
...
c3.min.js
View file @
65197230
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/axis.js
View file @
65197230
...
...
@@ -175,6 +175,7 @@ c3_chart_internal_fn.setAxisLabelText = function (axisId, text) {
c3_chart_internal_fn
.
getAxisLabelPosition
=
function
(
axisId
,
defaultPosition
)
{
var
option
=
this
.
getAxisLabelOptionByAxisId
(
axisId
),
position
=
(
option
&&
typeof
option
===
'object'
&&
option
.
position
)
?
option
.
position
:
defaultPosition
;
return
{
isInner
:
position
.
indexOf
(
'inner'
)
>=
0
,
isOuter
:
position
.
indexOf
(
'outer'
)
>=
0
,
...
...
@@ -230,10 +231,12 @@ c3_chart_internal_fn.textAnchorForAxisLabel = function (forHorizontal, position)
}
};
c3_chart_internal_fn
.
xForXAxisLabel
=
function
()
{
return
this
.
xForAxisLabel
(
!
this
.
config
.
axis_rotated
,
this
.
getXAxisLabelPosition
());
var
x
=
this
.
xForAxisLabel
(
!
this
.
config
.
axis_rotated
,
this
.
getXAxisLabelPosition
());
return
x
;
};
c3_chart_internal_fn
.
xForYAxisLabel
=
function
()
{
return
this
.
xForAxisLabel
(
this
.
config
.
axis_rotated
,
this
.
getYAxisLabelPosition
());
var
x
=
this
.
xForAxisLabel
(
this
.
config
.
axis_rotated
,
this
.
getYAxisLabelPosition
());
return
x
;
};
c3_chart_internal_fn
.
xForY2AxisLabel
=
function
()
{
return
this
.
xForAxisLabel
(
this
.
config
.
axis_rotated
,
this
.
getY2AxisLabelPosition
());
...
...
@@ -364,18 +367,15 @@ c3_chart_internal_fn.updateAxisLabels = function (withTransition) {
axisYLabel
=
$$
.
main
.
select
(
'.'
+
CLASS
.
axisY
+
' .'
+
CLASS
.
axisYLabel
),
axisY2Label
=
$$
.
main
.
select
(
'.'
+
CLASS
.
axisY2
+
' .'
+
CLASS
.
axisY2Label
);
var
duration
=
$$
.
config
.
transition_duration
;
(
withTransition
?
axisXLabel
.
transition
().
duration
(
duration
)
:
axisXLabel
)
.
attr
(
"x"
,
$$
.
xForXAxisLabel
.
bind
(
$$
))
axisXLabel
.
attr
(
"x"
,
$$
.
xForXAxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForXAxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForXAxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForXAxisLabel
.
bind
(
$$
));
(
withTransition
?
axisYLabel
.
transition
().
duration
(
duration
)
:
axisYLabel
)
.
attr
(
"x"
,
$$
.
xForYAxisLabel
.
bind
(
$$
))
axisYLabel
.
attr
(
"x"
,
$$
.
xForYAxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForYAxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForYAxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForYAxisLabel
.
bind
(
$$
));
(
withTransition
?
axisY2Label
.
transition
().
duration
(
duration
)
:
axisY2Label
)
.
attr
(
"x"
,
$$
.
xForY2AxisLabel
.
bind
(
$$
))
axisY2Label
.
attr
(
"x"
,
$$
.
xForY2AxisLabel
.
bind
(
$$
))
.
attr
(
"dx"
,
$$
.
dxForY2AxisLabel
.
bind
(
$$
))
.
attr
(
"dy"
,
$$
.
dyForY2AxisLabel
.
bind
(
$$
))
.
text
(
$$
.
textForY2AxisLabel
.
bind
(
$$
));
...
...
@@ -451,9 +451,8 @@ c3_chart_internal_fn.redrawAxis = function (transitions, isHidden) {
$$
.
rotateTickText
(
$$
.
axes
.
subx
,
transitions
.
axisSubX
,
config
.
axis_x_tick_rotate
);
}
//$$.updateSizes();
//$$.updateScales();
//$$.updateSvgSize();
$$
.
updateAxisLabels
();
};
c3_chart_internal_fn
.
tuneAxisTicks
=
function
(){
...
...
src/core.js
View file @
65197230
...
...
@@ -754,6 +754,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
if
(
flow
)
{
flow
();
}
if
(
config
.
onrendered
)
{
config
.
onrendered
.
call
(
$$
);
}
...
...
@@ -764,6 +765,7 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
$$
.
redrawLine
(
drawLine
);
$$
.
redrawArea
(
drawArea
);
$$
.
redrawCircle
(
cx
,
cy
);
if
(
config
.
onrendered
)
{
config
.
onrendered
.
call
(
$$
);
}
...
...
@@ -791,7 +793,7 @@ c3_chart_internal_fn.updateAndRedraw = function (options) {
false
;
// MEMO: this needs to be called before updateLegend and it means this ALWAYS needs to be called)
$$
.
updateSizes
();
transitions
=
$$
.
generateAxisTransitions
(
options
.
withTransitionForAxis
?
config
.
transition_duration
:
0
);
transitions
=
$$
.
generateAxisTransitions
(
0
);
// MEMO: called in updateLegend in redraw if withLegend
if
(
!
(
options
.
withLegend
&&
config
.
legend_show
))
{
...
...
@@ -804,9 +806,11 @@ c3_chart_internal_fn.updateAndRedraw = function (options) {
$$
.
redrawAxis
(
transitions
);
// MEMO: Draw with new sizes & scales
$$
.
updateSizes
();
$$
.
updateScales
();
$$
.
updateSvgSize
();
$$
.
redraw
(
options
,
transitions
);
};
c3_chart_internal_fn
.
redrawWithoutRescale
=
function
()
{
this
.
redraw
({
...
...
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