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
d3342f46
Commit
d3342f46
authored
Mar 10, 2015
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix data.region dash line - #989
parent
9e3efb97
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
8 deletions
+40
-8
c3.js
c3.js
+20
-4
c3.min.js
c3.min.js
+0
-0
shape.line.js
src/shape.line.js
+20
-4
No files found.
c3.js
View file @
d3342f46
...
@@ -2858,6 +2858,7 @@
...
@@ -2858,6 +2858,7 @@
prev
=
-
1
,
i
,
j
,
prev
=
-
1
,
i
,
j
,
s
=
"M"
,
sWithRegion
,
s
=
"M"
,
sWithRegion
,
xp
,
yp
,
dx
,
dy
,
dd
,
diff
,
diffx2
,
xp
,
yp
,
dx
,
dy
,
dd
,
diff
,
diffx2
,
xOffset
=
$$
.
isCategorized
()
?
0.5
:
0
,
xValue
,
yValue
,
xValue
,
yValue
,
regions
=
[];
regions
=
[];
...
@@ -2891,16 +2892,31 @@
...
@@ -2891,16 +2892,31 @@
yValue
=
config
.
axis_rotated
?
function
(
d
)
{
return
x
(
d
.
x
);
}
:
function
(
d
)
{
return
y
(
d
.
value
);
};
yValue
=
config
.
axis_rotated
?
function
(
d
)
{
return
x
(
d
.
x
);
}
:
function
(
d
)
{
return
y
(
d
.
value
);
};
// Define svg generator function for region
// Define svg generator function for region
function
generateM
(
points
)
{
return
'M'
+
points
[
0
][
0
]
+
' '
+
points
[
0
][
1
]
+
' '
+
points
[
1
][
0
]
+
' '
+
points
[
1
][
1
];
}
if
(
$$
.
isTimeSeries
())
{
if
(
$$
.
isTimeSeries
())
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
var
x0
=
d0
.
x
.
getTime
(),
x_diff
=
d1
.
x
-
d0
.
x
,
var
x0
=
d0
.
x
.
getTime
(),
x_diff
=
d1
.
x
-
d0
.
x
,
xv0
=
new
Date
(
x0
+
x_diff
*
j
),
xv0
=
new
Date
(
x0
+
x_diff
*
j
),
xv1
=
new
Date
(
x0
+
x_diff
*
(
j
+
diff
));
xv1
=
new
Date
(
x0
+
x_diff
*
(
j
+
diff
)),
return
"M"
+
x
(
xv0
)
+
" "
+
y
(
yp
(
j
))
+
" "
+
x
(
xv1
)
+
" "
+
y
(
yp
(
j
+
diff
));
points
;
if
(
config
.
axis_rotated
)
{
points
=
[[
y
(
yp
(
j
)),
x
(
xv0
)],
[
y
(
yp
(
j
+
diff
)),
x
(
xv1
)]];
}
else
{
points
=
[[
x
(
xv0
),
y
(
yp
(
j
))],
[
x
(
xv1
),
y
(
yp
(
j
+
diff
))]];
}
return
generateM
(
points
);
};
};
}
else
{
}
else
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
return
"M"
+
x
(
xp
(
j
),
true
)
+
" "
+
y
(
yp
(
j
))
+
" "
+
x
(
xp
(
j
+
diff
),
true
)
+
" "
+
y
(
yp
(
j
+
diff
));
var
points
;
if
(
config
.
axis_rotated
)
{
points
=
[[
y
(
yp
(
j
),
true
),
x
(
xp
(
j
))],
[
y
(
yp
(
j
+
diff
),
true
),
x
(
xp
(
j
+
diff
))]];
}
else
{
points
=
[[
x
(
xp
(
j
),
true
),
y
(
yp
(
j
))],
[
x
(
xp
(
j
+
diff
),
true
),
y
(
yp
(
j
+
diff
))]];
}
return
generateM
(
points
);
};
};
}
}
...
@@ -2913,7 +2929,7 @@
...
@@ -2913,7 +2929,7 @@
}
}
// Draw with region // TODO: Fix for horizotal charts
// Draw with region // TODO: Fix for horizotal charts
else
{
else
{
xp
=
$$
.
getScale
(
d
[
i
-
1
].
x
,
d
[
i
].
x
,
$$
.
isTimeSeries
());
xp
=
$$
.
getScale
(
d
[
i
-
1
].
x
+
xOffset
,
d
[
i
].
x
+
xOffset
,
$$
.
isTimeSeries
());
yp
=
$$
.
getScale
(
d
[
i
-
1
].
value
,
d
[
i
].
value
);
yp
=
$$
.
getScale
(
d
[
i
-
1
].
value
,
d
[
i
].
value
);
dx
=
x
(
d
[
i
].
x
)
-
x
(
d
[
i
-
1
].
x
);
dx
=
x
(
d
[
i
].
x
)
-
x
(
d
[
i
-
1
].
x
);
...
...
c3.min.js
View file @
d3342f46
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/shape.line.js
View file @
d3342f46
...
@@ -125,6 +125,7 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
...
@@ -125,6 +125,7 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
prev
=
-
1
,
i
,
j
,
prev
=
-
1
,
i
,
j
,
s
=
"M"
,
sWithRegion
,
s
=
"M"
,
sWithRegion
,
xp
,
yp
,
dx
,
dy
,
dd
,
diff
,
diffx2
,
xp
,
yp
,
dx
,
dy
,
dd
,
diff
,
diffx2
,
xOffset
=
$$
.
isCategorized
()
?
0.5
:
0
,
xValue
,
yValue
,
xValue
,
yValue
,
regions
=
[];
regions
=
[];
...
@@ -158,16 +159,31 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
...
@@ -158,16 +159,31 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
yValue
=
config
.
axis_rotated
?
function
(
d
)
{
return
x
(
d
.
x
);
}
:
function
(
d
)
{
return
y
(
d
.
value
);
};
yValue
=
config
.
axis_rotated
?
function
(
d
)
{
return
x
(
d
.
x
);
}
:
function
(
d
)
{
return
y
(
d
.
value
);
};
// Define svg generator function for region
// Define svg generator function for region
function
generateM
(
points
)
{
return
'M'
+
points
[
0
][
0
]
+
' '
+
points
[
0
][
1
]
+
' '
+
points
[
1
][
0
]
+
' '
+
points
[
1
][
1
];
}
if
(
$$
.
isTimeSeries
())
{
if
(
$$
.
isTimeSeries
())
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
var
x0
=
d0
.
x
.
getTime
(),
x_diff
=
d1
.
x
-
d0
.
x
,
var
x0
=
d0
.
x
.
getTime
(),
x_diff
=
d1
.
x
-
d0
.
x
,
xv0
=
new
Date
(
x0
+
x_diff
*
j
),
xv0
=
new
Date
(
x0
+
x_diff
*
j
),
xv1
=
new
Date
(
x0
+
x_diff
*
(
j
+
diff
));
xv1
=
new
Date
(
x0
+
x_diff
*
(
j
+
diff
)),
return
"M"
+
x
(
xv0
)
+
" "
+
y
(
yp
(
j
))
+
" "
+
x
(
xv1
)
+
" "
+
y
(
yp
(
j
+
diff
));
points
;
if
(
config
.
axis_rotated
)
{
points
=
[[
y
(
yp
(
j
)),
x
(
xv0
)],
[
y
(
yp
(
j
+
diff
)),
x
(
xv1
)]];
}
else
{
points
=
[[
x
(
xv0
),
y
(
yp
(
j
))],
[
x
(
xv1
),
y
(
yp
(
j
+
diff
))]];
}
return
generateM
(
points
);
};
};
}
else
{
}
else
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
sWithRegion
=
function
(
d0
,
d1
,
j
,
diff
)
{
return
"M"
+
x
(
xp
(
j
),
true
)
+
" "
+
y
(
yp
(
j
))
+
" "
+
x
(
xp
(
j
+
diff
),
true
)
+
" "
+
y
(
yp
(
j
+
diff
));
var
points
;
if
(
config
.
axis_rotated
)
{
points
=
[[
y
(
yp
(
j
),
true
),
x
(
xp
(
j
))],
[
y
(
yp
(
j
+
diff
),
true
),
x
(
xp
(
j
+
diff
))]];
}
else
{
points
=
[[
x
(
xp
(
j
),
true
),
y
(
yp
(
j
))],
[
x
(
xp
(
j
+
diff
),
true
),
y
(
yp
(
j
+
diff
))]];
}
return
generateM
(
points
);
};
};
}
}
...
@@ -180,7 +196,7 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
...
@@ -180,7 +196,7 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
}
}
// Draw with region // TODO: Fix for horizotal charts
// Draw with region // TODO: Fix for horizotal charts
else
{
else
{
xp
=
$$
.
getScale
(
d
[
i
-
1
].
x
,
d
[
i
].
x
,
$$
.
isTimeSeries
());
xp
=
$$
.
getScale
(
d
[
i
-
1
].
x
+
xOffset
,
d
[
i
].
x
+
xOffset
,
$$
.
isTimeSeries
());
yp
=
$$
.
getScale
(
d
[
i
-
1
].
value
,
d
[
i
].
value
);
yp
=
$$
.
getScale
(
d
[
i
-
1
].
value
,
d
[
i
].
value
);
dx
=
x
(
d
[
i
].
x
)
-
x
(
d
[
i
-
1
].
x
);
dx
=
x
(
d
[
i
].
x
)
-
x
(
d
[
i
-
1
].
x
);
...
...
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