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
76b44b33
Commit
76b44b33
authored
May 05, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Math.ceil not needed - #204
parent
4b7aea96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
c3.js
c3.js
+15
-14
No files found.
c3.js
View file @
76b44b33
...
@@ -334,13 +334,13 @@
...
@@ -334,13 +334,13 @@
subXOrient
=
__axis_rotated
?
"left"
:
"bottom"
;
subXOrient
=
__axis_rotated
?
"left"
:
"bottom"
;
var
translate
=
{
var
translate
=
{
main
:
function
()
{
return
"translate("
+
(
Math
.
ceil
(
margin
.
left
)
+
0.5
)
+
","
+
(
Math
.
ceil
(
margin
.
top
)
+
0.5
)
+
")"
;
},
main
:
function
()
{
return
"translate("
+
margin
.
left
+
","
+
margin
.
top
+
")"
;
},
context
:
function
()
{
return
"translate("
+
(
Math
.
ceil
(
margin2
.
left
)
+
0.5
)
+
","
+
(
Math
.
ceil
(
margin2
.
top
)
+
0.5
)
+
")"
;
},
context
:
function
()
{
return
"translate("
+
margin2
.
left
+
","
+
margin2
.
top
+
")"
;
},
legend
:
function
()
{
return
"translate("
+
margin3
.
left
+
","
+
margin3
.
top
+
")"
;
},
legend
:
function
()
{
return
"translate("
+
margin3
.
left
+
","
+
margin3
.
top
+
")"
;
},
x
:
function
()
{
return
"translate(0,"
+
(
__axis_rotated
?
0
:
height
)
+
")"
;
},
x
:
function
()
{
return
"translate(0,"
+
(
__axis_rotated
?
0
:
height
)
+
")"
;
},
y
:
function
()
{
return
"translate(0,"
+
(
__axis_rotated
?
height
:
0
)
+
")"
;
},
y
:
function
()
{
return
"translate(0,"
+
(
__axis_rotated
?
height
:
0
)
+
")"
;
},
y2
:
function
()
{
return
"translate("
+
(
__axis_rotated
?
0
:
width
)
+
","
+
(
__axis_rotated
?
1
:
0
)
+
")"
;
},
y2
:
function
()
{
return
"translate("
+
(
__axis_rotated
?
0
:
width
)
+
","
+
(
__axis_rotated
?
1
:
0
)
+
")"
;
},
subx
:
function
()
{
return
"translate(0,"
+
(
__axis_rotated
?
0
:
Math
.
ceil
(
height2
)
)
+
")"
;
},
subx
:
function
()
{
return
"translate(0,"
+
(
__axis_rotated
?
0
:
height2
)
+
")"
;
},
arc
:
function
()
{
return
"translate("
+
width
/
2
+
","
+
height
/
2
+
")"
;
}
arc
:
function
()
{
return
"translate("
+
width
/
2
+
","
+
height
/
2
+
")"
;
}
};
};
...
@@ -404,6 +404,7 @@
...
@@ -404,6 +404,7 @@
// TODO: configurabale
// TODO: configurabale
var
rotated_padding_left
=
30
,
rotated_padding_right
=
__axis_rotated
&&
!
__axis_x_show
?
0
:
30
,
rotated_padding_top
=
5
;
var
rotated_padding_left
=
30
,
rotated_padding_right
=
__axis_rotated
&&
!
__axis_x_show
?
0
:
30
,
rotated_padding_top
=
5
;
// MEMO: each value should be int to avoid disabling antialiasing
function
updateSizes
()
{
function
updateSizes
()
{
var
legendHeight
=
getLegendHeight
(),
legendWidth
=
getLegendWidth
(),
var
legendHeight
=
getLegendHeight
(),
legendWidth
=
getLegendWidth
(),
legendHeightForBottom
=
isLegendRight
?
0
:
legendHeight
,
legendHeightForBottom
=
isLegendRight
?
0
:
legendHeight
,
...
@@ -469,9 +470,9 @@
...
@@ -469,9 +470,9 @@
function
updateXgridFocus
()
{
function
updateXgridFocus
()
{
main
.
select
(
'line.'
+
CLASS
.
xgridFocus
)
main
.
select
(
'line.'
+
CLASS
.
xgridFocus
)
.
attr
(
"x1"
,
__axis_rotated
?
0
:
-
10
)
.
attr
(
"x1"
,
__axis_rotated
?
0
:
-
10
)
.
attr
(
"x2"
,
__axis_rotated
?
Math
.
ceil
(
width
)
:
-
10
)
.
attr
(
"x2"
,
__axis_rotated
?
width
:
-
10
)
.
attr
(
"y1"
,
__axis_rotated
?
-
10
:
Math
.
ceil
(
margin
.
top
)
)
.
attr
(
"y1"
,
__axis_rotated
?
-
10
:
margin
.
top
)
.
attr
(
"y2"
,
__axis_rotated
?
-
10
:
Math
.
ceil
(
height
)
);
.
attr
(
"y2"
,
__axis_rotated
?
-
10
:
height
);
}
}
function
updateRadius
()
{
function
updateRadius
()
{
radiusExpanded
=
height
/
2
;
radiusExpanded
=
height
/
2
;
...
@@ -3135,14 +3136,14 @@
...
@@ -3135,14 +3136,14 @@
xgridData
=
generateGridData
(
__grid_x_type
,
x
);
xgridData
=
generateGridData
(
__grid_x_type
,
x
);
xgridAttr
=
__axis_rotated
?
{
xgridAttr
=
__axis_rotated
?
{
'x1'
:
0
,
'x1'
:
0
,
'x2'
:
Math
.
ceil
(
width
)
,
'x2'
:
width
,
'y1'
:
function
(
d
)
{
return
x
(
d
)
-
tickOffset
;
},
'y1'
:
function
(
d
)
{
return
x
(
d
)
-
tickOffset
;
},
'y2'
:
function
(
d
)
{
return
x
(
d
)
-
tickOffset
;
}
'y2'
:
function
(
d
)
{
return
x
(
d
)
-
tickOffset
;
}
}
:
{
}
:
{
'x1'
:
function
(
d
)
{
return
x
(
d
)
+
tickOffset
;
},
'x1'
:
function
(
d
)
{
return
x
(
d
)
+
tickOffset
;
},
'x2'
:
function
(
d
)
{
return
x
(
d
)
+
tickOffset
;
},
'x2'
:
function
(
d
)
{
return
x
(
d
)
+
tickOffset
;
},
'y1'
:
Math
.
ceil
(
margin
.
top
)
,
'y1'
:
margin
.
top
,
'y2'
:
Math
.
ceil
(
height
)
'y2'
:
height
};
};
xgrid
=
main
.
select
(
'.'
+
CLASS
.
xgrids
).
selectAll
(
'.'
+
CLASS
.
xgrid
)
xgrid
=
main
.
select
(
'.'
+
CLASS
.
xgrids
).
selectAll
(
'.'
+
CLASS
.
xgrid
)
.
data
(
xgridData
);
.
data
(
xgridData
);
...
@@ -3169,9 +3170,9 @@
...
@@ -3169,9 +3170,9 @@
xgridLines
.
select
(
'line'
)
xgridLines
.
select
(
'line'
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
attr
(
"x1"
,
__axis_rotated
?
0
:
xv
)
.
attr
(
"x1"
,
__axis_rotated
?
0
:
xv
)
.
attr
(
"x2"
,
__axis_rotated
?
Math
.
ceil
(
width
)
:
xv
)
.
attr
(
"x2"
,
__axis_rotated
?
width
:
xv
)
.
attr
(
"y1"
,
__axis_rotated
?
xv
:
Math
.
ceil
(
margin
.
top
)
)
.
attr
(
"y1"
,
__axis_rotated
?
xv
:
margin
.
top
)
.
attr
(
"y2"
,
__axis_rotated
?
xv
:
Math
.
ceil
(
height
)
)
.
attr
(
"y2"
,
__axis_rotated
?
xv
:
height
)
.
style
(
"opacity"
,
1
);
.
style
(
"opacity"
,
1
);
xgridLines
.
select
(
'text'
)
xgridLines
.
select
(
'text'
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
...
@@ -3215,9 +3216,9 @@
...
@@ -3215,9 +3216,9 @@
ygridLines
.
select
(
'line'
)
ygridLines
.
select
(
'line'
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
attr
(
"x1"
,
__axis_rotated
?
yv
:
0
)
.
attr
(
"x1"
,
__axis_rotated
?
yv
:
0
)
.
attr
(
"x2"
,
__axis_rotated
?
yv
:
Math
.
ceil
(
width
)
)
.
attr
(
"x2"
,
__axis_rotated
?
yv
:
width
)
.
attr
(
"y1"
,
__axis_rotated
?
0
:
yv
)
.
attr
(
"y1"
,
__axis_rotated
?
0
:
yv
)
.
attr
(
"y2"
,
__axis_rotated
?
Math
.
ceil
(
height
)
:
yv
)
.
attr
(
"y2"
,
__axis_rotated
?
height
:
yv
)
.
style
(
"opacity"
,
1
);
.
style
(
"opacity"
,
1
);
ygridLines
.
select
(
'text'
)
ygridLines
.
select
(
'text'
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
...
...
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