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
c2f8cce4
Commit
c2f8cce4
authored
May 05, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix grid lines - #204
parent
009d4c76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
17 deletions
+13
-17
c3.js
c3.js
+13
-17
No files found.
c3.js
View file @
c2f8cce4
...
@@ -1843,11 +1843,11 @@
...
@@ -1843,11 +1843,11 @@
return
d
?
x
(
d
.
x
)
:
null
;
return
d
?
x
(
d
.
x
)
:
null
;
}
}
function
xv
(
d
)
{
function
xv
(
d
)
{
return
x
(
isTimeSeries
?
parseDate
(
d
.
value
)
:
d
.
value
);
return
Math
.
ceil
(
x
(
isTimeSeries
?
parseDate
(
d
.
value
)
:
d
.
value
)
);
}
}
function
yv
(
d
)
{
function
yv
(
d
)
{
var
yScale
=
d
.
axis
&&
d
.
axis
===
'y2'
?
y2
:
y
;
var
yScale
=
d
.
axis
&&
d
.
axis
===
'y2'
?
y2
:
y
;
return
yScale
(
d
.
value
);
return
Math
.
ceil
(
yScale
(
d
.
value
)
);
}
}
function
subxx
(
d
)
{
function
subxx
(
d
)
{
return
subX
(
d
.
x
);
return
subX
(
d
.
x
);
...
@@ -2009,7 +2009,6 @@
...
@@ -2009,7 +2009,6 @@
.
attr
(
__axis_rotated
?
'y1'
:
'x1'
,
xx
)
.
attr
(
__axis_rotated
?
'y1'
:
'x1'
,
xx
)
.
attr
(
__axis_rotated
?
'y2'
:
'x2'
,
xx
);
.
attr
(
__axis_rotated
?
'y2'
:
'x2'
,
xx
);
smoothLines
(
focusEl
,
'grid'
);
smoothLines
(
focusEl
,
'grid'
);
}
}
function
hideXGridFocus
()
{
function
hideXGridFocus
()
{
main
.
select
(
'line.'
+
CLASS
.
xgridFocus
).
style
(
"visibility"
,
"hidden"
);
main
.
select
(
'line.'
+
CLASS
.
xgridFocus
).
style
(
"visibility"
,
"hidden"
);
...
@@ -3176,7 +3175,6 @@
...
@@ -3176,7 +3175,6 @@
}
}
function
redraw
(
options
)
{
function
redraw
(
options
)
{
var
xaxis
,
subxaxis
,
yaxis
,
y2axis
,
xgrid
,
xgridData
,
xgridLines
,
xgridLine
,
ygrid
,
ygridLines
,
ygridLine
;
var
xaxis
,
subxaxis
,
yaxis
,
y2axis
,
xgrid
,
xgridData
,
xgridLines
,
xgridLine
,
ygrid
,
ygridLines
,
ygridLine
;
var
mainLine
,
mainArea
,
mainCircle
,
mainBar
,
mainArc
,
mainRegion
,
mainText
,
contextLine
,
contextBar
,
eventRect
,
eventRectUpdate
;
var
mainLine
,
mainArea
,
mainCircle
,
mainBar
,
mainArc
,
mainRegion
,
mainText
,
contextLine
,
contextBar
,
eventRect
,
eventRectUpdate
;
var
barIndices
=
getBarIndices
(),
maxDataCountTarget
;
var
barIndices
=
getBarIndices
(),
maxDataCountTarget
;
...
@@ -3257,19 +3255,19 @@
...
@@ -3257,19 +3255,19 @@
smoothLines
(
d3
.
select
(
this
),
'tick'
);
smoothLines
(
d3
.
select
(
this
),
'tick'
);
});
});
});
});
transitions
.
axisY
.
call
(
yAxis
).
each
(
'end'
,
function
()
{
transitions
.
axisY
.
call
(
yAxis
).
each
(
'end'
,
function
()
{
d3
.
select
(
this
).
selectAll
(
'.tick'
).
each
(
function
()
{
d3
.
select
(
this
).
selectAll
(
'.tick'
).
each
(
function
()
{
smoothLines
(
d3
.
select
(
this
),
'tick'
);
smoothLines
(
d3
.
select
(
this
),
'tick'
);
});
});
});
});
transitions
.
axisY2
.
call
(
y2Axis
).
each
(
'end'
,
function
()
{
transitions
.
axisY2
.
call
(
y2Axis
).
each
(
'end'
,
function
()
{
d3
.
select
(
this
).
selectAll
(
'.tick'
).
each
(
function
()
{
d3
.
select
(
this
).
selectAll
(
'.tick'
).
each
(
function
()
{
smoothLines
(
d3
.
select
(
this
),
'tick'
);
smoothLines
(
d3
.
select
(
this
),
'tick'
);
});
});
});
});
transitions
.
axisSubX
.
call
(
subXAxis
).
each
(
'end'
,
function
()
{
transitions
.
axisSubX
.
call
(
subXAxis
).
each
(
'end'
,
function
()
{
d3
.
select
(
this
).
selectAll
(
'.tick'
).
each
(
function
()
{
d3
.
select
(
this
).
selectAll
(
'.tick'
).
each
(
function
()
{
smoothLines
(
d3
.
select
(
this
),
'tick'
);
smoothLines
(
d3
.
select
(
this
),
'tick'
);
...
@@ -3361,10 +3359,10 @@
...
@@ -3361,10 +3359,10 @@
// udpate
// udpate
xgridLines
.
select
(
'line'
)
xgridLines
.
select
(
'line'
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
attr
(
"x1"
,
__axis_rotated
?
0
:
Math
.
ceil
(
xv
)
)
.
attr
(
"x1"
,
__axis_rotated
?
0
:
xv
)
.
attr
(
"x2"
,
__axis_rotated
?
Math
.
ceil
(
width
)
:
Math
.
ceil
(
xv
)
)
.
attr
(
"x2"
,
__axis_rotated
?
Math
.
ceil
(
width
)
:
xv
)
.
attr
(
"y1"
,
__axis_rotated
?
Math
.
ceil
(
xv
)
:
Math
.
ceil
(
margin
.
top
))
.
attr
(
"y1"
,
__axis_rotated
?
xv
:
Math
.
ceil
(
margin
.
top
))
.
attr
(
"y2"
,
__axis_rotated
?
Math
.
ceil
(
xv
)
:
Math
.
ceil
(
height
))
.
attr
(
"y2"
,
__axis_rotated
?
xv
:
Math
.
ceil
(
height
))
.
style
(
"opacity"
,
1
);
.
style
(
"opacity"
,
1
);
xgridLines
.
select
(
'text'
)
xgridLines
.
select
(
'text'
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
...
@@ -3388,9 +3386,7 @@
...
@@ -3388,9 +3386,7 @@
.
attr
(
"y1"
,
__axis_rotated
?
0
:
y
)
.
attr
(
"y1"
,
__axis_rotated
?
0
:
y
)
.
attr
(
"y2"
,
__axis_rotated
?
height
:
y
);
.
attr
(
"y2"
,
__axis_rotated
?
height
:
y
);
ygrid
.
exit
().
remove
();
ygrid
.
exit
().
remove
();
smoothLines
(
ygrid
,
'grid'
);
smoothLines
(
ygrid
,
'grid'
);
}
}
if
(
withY
&&
notEmpty
(
__grid_y_lines
))
{
if
(
withY
&&
notEmpty
(
__grid_y_lines
))
{
ygridLines
=
main
.
select
(
'.'
+
CLASS
.
ygridLines
).
selectAll
(
'.'
+
CLASS
.
ygridLine
)
ygridLines
=
main
.
select
(
'.'
+
CLASS
.
ygridLines
).
selectAll
(
'.'
+
CLASS
.
ygridLine
)
...
@@ -3409,10 +3405,10 @@
...
@@ -3409,10 +3405,10 @@
// update
// update
ygridLines
.
select
(
'line'
)
ygridLines
.
select
(
'line'
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
attr
(
"x1"
,
__axis_rotated
?
Math
.
ceil
(
yv
)
:
0
)
.
attr
(
"x1"
,
__axis_rotated
?
yv
:
0
)
.
attr
(
"x2"
,
__axis_rotated
?
Math
.
ceil
(
yv
)
:
Math
.
ceil
(
width
))
.
attr
(
"x2"
,
__axis_rotated
?
yv
:
Math
.
ceil
(
width
))
.
attr
(
"y1"
,
__axis_rotated
?
0
:
Math
.
ceil
(
yv
)
)
.
attr
(
"y1"
,
__axis_rotated
?
0
:
yv
)
.
attr
(
"y2"
,
__axis_rotated
?
Math
.
ceil
(
height
)
:
Math
.
ceil
(
yv
)
)
.
attr
(
"y2"
,
__axis_rotated
?
Math
.
ceil
(
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