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
034fad22
Commit
034fad22
authored
Jul 16, 2015
by
Amir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update getShapeOffset() to allow data series with unequal amount of x-values
Refs issue#1065
parent
4b34a195
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
shape.js
src/shape.js
+15
-0
No files found.
src/shape.js
View file @
034fad22
...
...
@@ -41,10 +41,25 @@ c3_chart_internal_fn.getShapeOffset = function (typeFilter, indices, isSub) {
var
values
=
$$
.
isStepType
(
d
)
?
$$
.
convertValuesToStep
(
t
.
values
)
:
t
.
values
;
if
(
t
.
id
===
d
.
id
||
indices
[
t
.
id
]
!==
indices
[
d
.
id
])
{
return
;
}
if
(
targetIds
.
indexOf
(
t
.
id
)
<
targetIds
.
indexOf
(
d
.
id
))
{
// check if the x values line up
if
(
typeof
values
[
i
]
===
'undefined'
||
(
values
[
i
].
x
!==
d
.
x
)
&&
(
values
[
i
].
x
-
d
.
x
!==
0
))
{
// if not, try to find the value that does line up
i
=
-
1
;
for
(
var
j
in
values
)
{
if
((
values
[
j
].
x
===
d
.
x
)
||
(
values
[
j
].
x
-
d
.
x
===
0
))
{
i
=
j
;
break
;
}
}
}
if
(
i
in
values
)
{
if
(
values
[
i
].
value
*
d
.
value
>=
0
)
{
offset
+=
scale
(
values
[
i
].
value
)
-
y0
;
}
}
}
});
return
offset
;
};
...
...
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