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
45204d81
You need to sign in or sign up before continuing.
Commit
45204d81
authored
May 15, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix line with null on sub chart - #229
parent
0f537789
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
30 deletions
+29
-30
c3.js
c3.js
+29
-30
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
45204d81
...
@@ -1694,7 +1694,7 @@
...
@@ -1694,7 +1694,7 @@
return
Math
.
ceil
(
yScale
(
d
.
value
));
return
Math
.
ceil
(
yScale
(
d
.
value
));
}
}
function
subxx
(
d
)
{
function
subxx
(
d
)
{
return
subX
(
d
.
x
)
;
return
d
?
subX
(
d
.
x
)
:
null
;
}
}
function
findSameXOfValues
(
values
,
index
)
{
function
findSameXOfValues
(
values
,
index
)
{
...
@@ -2207,24 +2207,8 @@
...
@@ -2207,24 +2207,8 @@
getBars
(
i
).
classed
(
CLASS
.
EXPANDED
,
false
);
getBars
(
i
).
classed
(
CLASS
.
EXPANDED
,
false
);
}
}
// For main region
var
lineOnMain
=
generateDrawLine
(
x
,
xx
,
getYScale
),
var
lineOnMain
=
(
function
()
{
lineOnSub
=
generateDrawLine
(
subX
,
subxx
,
getSubYScale
);
var
line
=
d3
.
svg
.
line
()
.
x
(
__axis_rotated
?
function
(
d
)
{
return
getYScale
(
d
.
id
)(
d
.
value
);
}
:
xx
)
.
y
(
__axis_rotated
?
xx
:
function
(
d
)
{
return
getYScale
(
d
.
id
)(
d
.
value
);
});
if
(
!
__line_connect_null
)
{
line
=
line
.
defined
(
function
(
d
)
{
return
d
.
value
!=
null
;
});
}
return
function
(
d
)
{
var
data
=
__line_connect_null
?
filterRemoveNull
(
d
.
values
)
:
d
.
values
,
x0
,
y0
;
if
(
isLineType
(
d
))
{
isSplineType
(
d
)
?
line
.
interpolate
(
"cardinal"
)
:
line
.
interpolate
(
"linear"
);
return
__data_regions
[
d
.
id
]
?
lineWithRegions
(
data
,
x
,
getYScale
(
d
.
id
),
__data_regions
[
d
.
id
])
:
line
(
data
);
}
else
{
x0
=
data
[
0
]
?
x
(
data
[
0
].
x
)
:
0
;
y0
=
data
[
0
]
?
getYScale
(
d
.
id
)(
data
[
0
].
value
)
:
0
;
return
__axis_rotated
?
"M "
+
y0
+
" "
+
x0
:
"M "
+
x0
+
" "
+
y0
;
}
};
})();
var
areaOnMain
=
(
function
()
{
var
areaOnMain
=
(
function
()
{
var
area
;
var
area
;
...
@@ -2255,6 +2239,32 @@
...
@@ -2255,6 +2239,32 @@
};
};
})();
})();
function
generateDrawLine
(
x
,
xValue
,
yScaleGetter
)
{
var
yValue
=
function
(
d
)
{
return
yScaleGetter
(
d
.
id
)(
d
.
value
);
},
line
=
d3
.
svg
.
line
()
.
x
(
__axis_rotated
?
yValue
:
xValue
)
.
y
(
__axis_rotated
?
xValue
:
yValue
);
if
(
!
__line_connect_null
)
{
line
=
line
.
defined
(
function
(
d
)
{
return
d
.
value
!=
null
;
});
}
return
function
(
d
)
{
var
data
=
__line_connect_null
?
filterRemoveNull
(
d
.
values
)
:
d
.
values
,
y
=
yScaleGetter
(
d
.
id
),
x0
=
0
,
y0
=
0
;
if
(
isLineType
(
d
))
{
if
(
__data_regions
[
d
.
id
])
{
return
lineWithRegions
(
data
,
x
,
y
,
__data_regions
[
d
.
id
]);
}
else
{
line
.
interpolate
(
isSplineType
(
d
)
?
"cardinal"
:
"linear"
);
return
line
(
data
);
}
}
else
{
if
(
data
[
0
])
{
x0
=
x
(
data
[
0
].
x
);
y0
=
y
(
data
[
0
].
value
);
}
return
__axis_rotated
?
"M "
+
y0
+
" "
+
x0
:
"M "
+
x0
+
" "
+
y0
;
}
};
}
function
generateDrawBar
(
barIndices
,
isSub
)
{
function
generateDrawBar
(
barIndices
,
isSub
)
{
var
getPoints
=
generateGetBarPoints
(
barIndices
,
isSub
);
var
getPoints
=
generateGetBarPoints
(
barIndices
,
isSub
);
return
function
(
d
,
i
)
{
return
function
(
d
,
i
)
{
...
@@ -2324,17 +2334,6 @@
...
@@ -2324,17 +2334,6 @@
};
};
}
}
// For brush region
var
lineOnSub
=
(
function
()
{
var
line
=
d3
.
svg
.
line
()
.
x
(
__axis_rotated
?
function
(
d
)
{
return
getSubYScale
(
d
.
id
)(
d
.
value
);
}
:
subxx
)
.
y
(
__axis_rotated
?
subxx
:
function
(
d
)
{
return
getSubYScale
(
d
.
id
)(
d
.
value
);
});
return
function
(
d
)
{
var
data
=
filterRemoveNull
(
d
.
values
);
return
isLineType
(
d
)
?
line
(
data
)
:
"M "
+
subX
(
data
[
0
].
x
)
+
" "
+
getSubYScale
(
d
.
id
)(
data
[
0
].
value
);
};
})();
function
lineWithRegions
(
d
,
x
,
y
,
_regions
)
{
function
lineWithRegions
(
d
,
x
,
y
,
_regions
)
{
var
prev
=
-
1
,
i
,
j
;
var
prev
=
-
1
,
i
,
j
;
var
s
=
"M"
,
sWithRegion
;
var
s
=
"M"
,
sWithRegion
;
...
...
c3.min.js
View file @
45204d81
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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