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
212e3c12
Commit
212e3c12
authored
Aug 13, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tick bug
parent
2647aeaf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
12 deletions
+28
-12
c3.js
c3.js
+14
-6
c3.min.js
c3.min.js
+0
-0
c3.axis.js
src/c3.axis.js
+14
-6
No files found.
c3.js
View file @
212e3c12
...
...
@@ -8417,8 +8417,7 @@
}
function
tickSize
(
d
)
{
var
tickPosition
=
scale
(
d
)
+
(
tickCentered
?
0
:
tickOffset
);
return
range
[
0
]
<
tickPosition
&&
tickPosition
<
range
[
1
]
?
innerTickSize
:
0
;
return
innerTickSize
;
}
text
=
tick
.
select
(
"text"
);
...
...
@@ -8503,7 +8502,9 @@
case
"bottom"
:
{
tickTransform
=
axisX
;
lineEnter
.
attr
(
"y2"
,
innerTickSize
);
lineEnter
.
attr
(
"y2"
,
function
(
d
,
i
){
return
innerTickSize
;
});
textEnter
.
attr
(
"y"
,
tickLength
);
lineUpdate
.
attr
(
"x1"
,
tickX
).
attr
(
"x2"
,
tickX
).
attr
(
"y2"
,
tickSize
);
textUpdate
.
attr
(
"x"
,
0
).
attr
(
"y"
,
tickLength
);
...
...
@@ -8515,7 +8516,9 @@
case
"top"
:
{
tickTransform
=
axisX
;
lineEnter
.
attr
(
"y2"
,
-
innerTickSize
);
lineEnter
.
attr
(
"y2"
,
function
(
d
,
i
){
return
-
innerTickSize
;
});
textEnter
.
attr
(
"y"
,
-
tickLength
);
lineUpdate
.
attr
(
"x2"
,
0
).
attr
(
"y2"
,
-
innerTickSize
);
textUpdate
.
attr
(
"x"
,
0
).
attr
(
"y"
,
-
tickLength
);
...
...
@@ -8529,7 +8532,9 @@
tickTransform
=
axisY
;
lineEnter
.
attr
(
"x2"
,
-
innerTickSize
);
textEnter
.
attr
(
"x"
,
-
tickLength
);
lineUpdate
.
attr
(
"x2"
,
-
innerTickSize
).
attr
(
"y1"
,
tickY
).
attr
(
"y2"
,
tickY
);
lineUpdate
.
attr
(
"x2"
,
-
innerTickSize
).
attr
(
"y1"
,
tickY
).
attr
(
"y2"
,
function
(
d
,
i
){
return
tickY
;
});
textUpdate
.
attr
(
"x"
,
-
tickLength
).
attr
(
"y"
,
tickOffset
);
text
.
style
(
"text-anchor"
,
"end"
);
tspan
.
attr
(
'x'
,
-
tickLength
).
attr
(
"dy"
,
tspanDy
);
...
...
@@ -8541,7 +8546,9 @@
tickTransform
=
axisY
;
lineEnter
.
attr
(
"x2"
,
innerTickSize
);
textEnter
.
attr
(
"x"
,
tickLength
);
lineUpdate
.
attr
(
"x2"
,
innerTickSize
).
attr
(
"y2"
,
0
);
lineUpdate
.
attr
(
"x2"
,
innerTickSize
).
attr
(
"y2"
,
function
(
d
,
i
){
return
0
;
});
textUpdate
.
attr
(
"x"
,
tickLength
).
attr
(
"y"
,
0
);
text
.
style
(
"text-anchor"
,
"start"
);
tspan
.
attr
(
'x'
,
tickLength
).
attr
(
"dy"
,
tspanDy
);
...
...
@@ -8549,6 +8556,7 @@
break
;
}
}
if
(
scale1
.
rangeBand
)
{
var
x
=
scale1
,
dx
=
x
.
rangeBand
()
/
2
;
scale0
=
scale1
=
function
(
d
)
{
...
...
c3.min.js
View file @
212e3c12
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/c3.axis.js
View file @
212e3c12
...
...
@@ -232,8 +232,7 @@ function c3_axis(d3, params, $$) {
}
function
tickSize
(
d
)
{
var
tickPosition
=
scale
(
d
)
+
(
tickCentered
?
0
:
tickOffset
);
return
range
[
0
]
<
tickPosition
&&
tickPosition
<
range
[
1
]
?
innerTickSize
:
0
;
return
innerTickSize
;
}
text
=
tick
.
select
(
"text"
);
...
...
@@ -318,7 +317,9 @@ function c3_axis(d3, params, $$) {
case
"bottom"
:
{
tickTransform
=
axisX
;
lineEnter
.
attr
(
"y2"
,
innerTickSize
);
lineEnter
.
attr
(
"y2"
,
function
(
d
,
i
){
return
innerTickSize
;
});
textEnter
.
attr
(
"y"
,
tickLength
);
lineUpdate
.
attr
(
"x1"
,
tickX
).
attr
(
"x2"
,
tickX
).
attr
(
"y2"
,
tickSize
);
textUpdate
.
attr
(
"x"
,
0
).
attr
(
"y"
,
tickLength
);
...
...
@@ -330,7 +331,9 @@ function c3_axis(d3, params, $$) {
case
"top"
:
{
tickTransform
=
axisX
;
lineEnter
.
attr
(
"y2"
,
-
innerTickSize
);
lineEnter
.
attr
(
"y2"
,
function
(
d
,
i
){
return
-
innerTickSize
;
});
textEnter
.
attr
(
"y"
,
-
tickLength
);
lineUpdate
.
attr
(
"x2"
,
0
).
attr
(
"y2"
,
-
innerTickSize
);
textUpdate
.
attr
(
"x"
,
0
).
attr
(
"y"
,
-
tickLength
);
...
...
@@ -344,7 +347,9 @@ function c3_axis(d3, params, $$) {
tickTransform
=
axisY
;
lineEnter
.
attr
(
"x2"
,
-
innerTickSize
);
textEnter
.
attr
(
"x"
,
-
tickLength
);
lineUpdate
.
attr
(
"x2"
,
-
innerTickSize
).
attr
(
"y1"
,
tickY
).
attr
(
"y2"
,
tickY
);
lineUpdate
.
attr
(
"x2"
,
-
innerTickSize
).
attr
(
"y1"
,
tickY
).
attr
(
"y2"
,
function
(
d
,
i
){
return
tickY
;
});
textUpdate
.
attr
(
"x"
,
-
tickLength
).
attr
(
"y"
,
tickOffset
);
text
.
style
(
"text-anchor"
,
"end"
);
tspan
.
attr
(
'x'
,
-
tickLength
).
attr
(
"dy"
,
tspanDy
);
...
...
@@ -356,7 +361,9 @@ function c3_axis(d3, params, $$) {
tickTransform
=
axisY
;
lineEnter
.
attr
(
"x2"
,
innerTickSize
);
textEnter
.
attr
(
"x"
,
tickLength
);
lineUpdate
.
attr
(
"x2"
,
innerTickSize
).
attr
(
"y2"
,
0
);
lineUpdate
.
attr
(
"x2"
,
innerTickSize
).
attr
(
"y2"
,
function
(
d
,
i
){
return
0
;
});
textUpdate
.
attr
(
"x"
,
tickLength
).
attr
(
"y"
,
0
);
text
.
style
(
"text-anchor"
,
"start"
);
tspan
.
attr
(
'x'
,
tickLength
).
attr
(
"dy"
,
tspanDy
);
...
...
@@ -364,6 +371,7 @@ function c3_axis(d3, params, $$) {
break
;
}
}
if
(
scale1
.
rangeBand
)
{
var
x
=
scale1
,
dx
=
x
.
rangeBand
()
/
2
;
scale0
=
scale1
=
function
(
d
)
{
...
...
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