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
Evgeny
c3-closed
Commits
735d5b10
Commit
735d5b10
authored
Nov 18, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tick width for non-fit category axis - #726
parent
5533e803
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
c3.js
c3.js
+2
-2
c3.min.js
c3.min.js
+0
-0
axis-spec.js
spec/axis-spec.js
+2
-2
c3.axis.js
src/c3.axis.js
+2
-2
No files found.
c3.js
View file @
735d5b10
...
@@ -6539,7 +6539,7 @@
...
@@ -6539,7 +6539,7 @@
}
}
if
(
!
maxWidth
||
maxWidth
<=
0
)
{
if
(
!
maxWidth
||
maxWidth
<=
0
)
{
maxWidth
=
isVertical
?
95
:
params
.
isCategory
?
(
tickOffset
*
2
-
10
)
:
110
;
maxWidth
=
isVertical
?
95
:
params
.
isCategory
?
(
Math
.
ceil
(
scale1
(
ticks
[
1
])
-
scale1
(
ticks
[
0
]))
-
10
)
:
110
;
}
}
function
split
(
splitted
,
text
)
{
function
split
(
splitted
,
text
)
{
...
@@ -6570,7 +6570,7 @@
...
@@ -6570,7 +6570,7 @@
if
(
orient
===
'left'
||
orient
===
'right'
)
{
if
(
orient
===
'left'
||
orient
===
'right'
)
{
dy
=
-
((
counts
[
d
.
index
]
-
1
)
*
(
sizeFor1Char
.
h
/
2
)
-
(
params
.
isCategory
?
2
:
3
));
dy
=
-
((
counts
[
d
.
index
]
-
1
)
*
(
sizeFor1Char
.
h
/
2
)
-
(
params
.
isCategory
?
2
:
3
));
}
else
{
}
else
{
dy
=
params
.
isCategory
?
".40em"
:
".71em"
;
dy
=
".71em"
;
}
}
}
}
return
dy
;
return
dy
;
...
...
c3.min.js
View file @
735d5b10
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/axis-spec.js
View file @
735d5b10
...
@@ -362,7 +362,7 @@ describe('c3 chart axis', function () {
...
@@ -362,7 +362,7 @@ describe('c3 chart axis', function () {
ticks
.
each
(
function
(
d
,
i
)
{
ticks
.
each
(
function
(
d
,
i
)
{
var
tspans
=
d3
.
select
(
this
).
selectAll
(
'tspan'
),
var
tspans
=
d3
.
select
(
this
).
selectAll
(
'tspan'
),
expectedX
=
'0'
,
expectedX
=
'0'
,
expectedDy
=
'.
40
em'
;
expectedDy
=
'.
71
em'
;
if
(
i
>
0
)
{
// i === 0 should be checked in next test
if
(
i
>
0
)
{
// i === 0 should be checked in next test
expect
(
tspans
.
size
()).
toBe
(
1
);
expect
(
tspans
.
size
()).
toBe
(
1
);
tspans
.
each
(
function
()
{
tspans
.
each
(
function
()
{
...
@@ -390,7 +390,7 @@ describe('c3 chart axis', function () {
...
@@ -390,7 +390,7 @@ describe('c3 chart axis', function () {
expect
(
tspan
.
attr
(
'x'
)).
toBe
(
expectedX
);
expect
(
tspan
.
attr
(
'x'
)).
toBe
(
expectedX
);
// unable to define pricise number because it differs depends on environment..
// unable to define pricise number because it differs depends on environment..
if
(
i
===
0
)
{
if
(
i
===
0
)
{
expect
(
tspan
.
attr
(
'dy'
)).
toBe
(
'.
40
em'
);
expect
(
tspan
.
attr
(
'dy'
)).
toBe
(
'.
71
em'
);
}
else
{
}
else
{
expect
(
tspan
.
attr
(
'dy'
)).
toBeGreaterThan
(
8
);
expect
(
tspan
.
attr
(
'dy'
)).
toBeGreaterThan
(
8
);
}
}
...
...
src/c3.axis.js
View file @
735d5b10
...
@@ -111,7 +111,7 @@ function c3_axis(d3, params) {
...
@@ -111,7 +111,7 @@ function c3_axis(d3, params) {
}
}
if
(
!
maxWidth
||
maxWidth
<=
0
)
{
if
(
!
maxWidth
||
maxWidth
<=
0
)
{
maxWidth
=
isVertical
?
95
:
params
.
isCategory
?
(
tickOffset
*
2
-
10
)
:
110
;
maxWidth
=
isVertical
?
95
:
params
.
isCategory
?
(
Math
.
ceil
(
scale1
(
ticks
[
1
])
-
scale1
(
ticks
[
0
]))
-
10
)
:
110
;
}
}
function
split
(
splitted
,
text
)
{
function
split
(
splitted
,
text
)
{
...
@@ -142,7 +142,7 @@ function c3_axis(d3, params) {
...
@@ -142,7 +142,7 @@ function c3_axis(d3, params) {
if
(
orient
===
'left'
||
orient
===
'right'
)
{
if
(
orient
===
'left'
||
orient
===
'right'
)
{
dy
=
-
((
counts
[
d
.
index
]
-
1
)
*
(
sizeFor1Char
.
h
/
2
)
-
(
params
.
isCategory
?
2
:
3
));
dy
=
-
((
counts
[
d
.
index
]
-
1
)
*
(
sizeFor1Char
.
h
/
2
)
-
(
params
.
isCategory
?
2
:
3
));
}
else
{
}
else
{
dy
=
params
.
isCategory
?
".40em"
:
".71em"
;
dy
=
".71em"
;
}
}
}
}
return
dy
;
return
dy
;
...
...
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