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
200091ee
Commit
200091ee
authored
May 01, 2014
by
Brandon Bernal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MAP-5811: Added area-step graph to subchart
parent
d17e6291
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
3 deletions
+44
-3
c3.js
c3.js
+44
-3
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
200091ee
...
@@ -2221,7 +2221,7 @@
...
@@ -2221,7 +2221,7 @@
isSplineType
(
d
)
?
area
.
interpolate
(
"cardinal"
)
:
area
.
interpolate
(
"linear"
);
isSplineType
(
d
)
?
area
.
interpolate
(
"cardinal"
)
:
area
.
interpolate
(
"linear"
);
return
area
(
data
);
return
area
(
data
);
}
else
if
(
hasType
([
d
],
'area-step'
))
{
}
else
if
(
hasType
([
d
],
'area-step'
))
{
isStepType
(
d
)
?
area
.
interpolate
(
"step-after"
)
:
''
;
isStepType
(
d
)
?
area
.
interpolate
(
"step-after"
)
:
area
.
interpolate
(
"linear"
)
;
return
area
(
data
);
return
area
(
data
);
}
else
{
}
else
{
x0
=
x
(
data
[
0
].
x
);
x0
=
x
(
data
[
0
].
x
);
...
@@ -2401,7 +2401,28 @@
...
@@ -2401,7 +2401,28 @@
.
y
(
__axis_rotated
?
subxx
:
function
(
d
)
{
return
getSubYScale
(
d
.
id
)(
d
.
value
);
});
.
y
(
__axis_rotated
?
subxx
:
function
(
d
)
{
return
getSubYScale
(
d
.
id
)(
d
.
value
);
});
return
function
(
d
)
{
return
function
(
d
)
{
var
data
=
filterRemoveNull
(
d
.
values
);
var
data
=
filterRemoveNull
(
d
.
values
);
return
isLineType
(
d
)
?
line
(
data
)
:
"M "
+
subX
(
data
[
0
].
x
)
+
" "
+
getSubYScale
(
d
.
id
)(
data
[
0
].
value
);
if
(
isLineType
(
d
))
{
return
line
(
data
);
}
else
if
(
isStepType
(
d
))
{
line
.
interpolate
(
"step-after"
);
return
line
(
data
);
}
else
{
return
"M "
+
subX
(
data
[
0
].
x
)
+
" "
+
getSubYScale
(
d
.
id
)(
data
[
0
].
value
);
}
};
})();
var
areaOnSub
=
(
function
()
{
var
area
=
d3
.
svg
.
area
()
.
x
(
xx
)
.
y0
(
function
(
d
,
i
)
{
if
(
__data_groups
.
length
>
0
)
{
var
point
=
getPoint
(
d
,
i
);
return
point
[
0
][
1
];
}
return
getSubYScale
(
d
.
id
)(
0
);
})
.
y1
(
function
(
d
,
i
)
{
if
(
__data_groups
.
length
>
0
)
{
var
point
=
getPoint
(
d
,
i
);
return
point
[
1
][
1
];
}
return
getSubYScale
(
d
.
id
)(
d
.
value
);
});
return
function
(
d
)
{
var
data
=
filterRemoveNull
(
d
.
values
);
if
(
isLineType
(
d
)
||
isStepType
(
d
))
{
return
area
(
data
);
}
else
{
return
"M "
+
subX
(
data
[
0
].
x
)
+
" "
+
getSubYScale
(
d
.
id
)(
data
[
0
].
value
);
}
};
};
})();
})();
...
@@ -3328,12 +3349,14 @@
...
@@ -3328,12 +3349,14 @@
// .attr("d", lineOnMain)
// .attr("d", lineOnMain)
.
attr
(
"d"
,
drawLine
)
.
attr
(
"d"
,
drawLine
)
.
style
(
"opacity"
,
1
);
.
style
(
"opacity"
,
1
);
// steps
main
.
selectAll
(
'.'
+
CLASS
.
step
)
main
.
selectAll
(
'.'
+
CLASS
.
step
)
.
style
(
"opacity"
,
initialOpacity
)
.
style
(
"opacity"
,
initialOpacity
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
// .attr("d", lineOnMain)
// .attr("d", lineOnMain)
.
attr
(
"d"
,
drawLine
)
.
attr
(
"d"
,
drawLine
)
.
style
(
"opacity"
,
1
);
.
style
(
"opacity"
,
1
);
// area
main
.
selectAll
(
'.'
+
CLASS
.
area
)
main
.
selectAll
(
'.'
+
CLASS
.
area
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
...
@@ -3425,11 +3448,18 @@
...
@@ -3425,11 +3448,18 @@
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
attr
(
"d"
,
lineOnSub
)
.
attr
(
"d"
,
lineOnSub
)
.
style
(
'opacity'
,
1
);
.
style
(
'opacity'
,
1
);
// steps
context
.
selectAll
(
'.'
+
CLASS
.
step
)
context
.
selectAll
(
'.'
+
CLASS
.
step
)
.
style
(
"opacity"
,
initialOpacity
)
.
style
(
"opacity"
,
initialOpacity
)
.
transition
().
duration
(
duration
)
.
transition
().
duration
(
duration
)
.
attr
(
"d"
,
lineOnSub
)
.
attr
(
"d"
,
lineOnSub
)
.
style
(
'opacity'
,
1
);
.
style
(
'opacity'
,
1
);
// area
context
.
selectAll
(
'.'
+
CLASS
.
area
)
.
style
(
"opacity"
,
initialOpacity
)
.
transition
().
duration
(
duration
)
.
attr
(
"d"
,
lineOnSub
)
.
style
(
'opacity'
,
orgAreaOpacity
);
}
}
}
}
...
@@ -3623,6 +3653,7 @@
...
@@ -3623,6 +3653,7 @@
.
attr
(
"class"
,
classLine
)
.
attr
(
"class"
,
classLine
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
// Steps
mainLineEnter
.
append
(
"path"
)
mainLineEnter
.
append
(
"path"
)
.
attr
(
'class'
,
classStep
)
.
attr
(
'class'
,
classStep
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
...
@@ -3630,7 +3661,7 @@
...
@@ -3630,7 +3661,7 @@
// Areas
// Areas
mainLineEnter
.
append
(
"path"
)
mainLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classArea
)
.
attr
(
"class"
,
classArea
)
.
style
(
"opacity"
,
function
()
{
orgAreaOpacity
=
(
__color_opacity
)
?
__color_opacity
:
1
;
return
0
;
})
//+d3.select(this).style('opacity'); return 0; })
.
style
(
"opacity"
,
function
()
{
orgAreaOpacity
=
(
__color_opacity
)
?
__color_opacity
:
1
;
return
orgAreaOpacity
;
})
//+d3.select(this).style('opacity'); return 0; })
.
style
(
"fill"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
.
style
(
"fill"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
// Circles for each data point on lines
// Circles for each data point on lines
mainLineEnter
.
append
(
'g'
)
mainLineEnter
.
append
(
'g'
)
...
@@ -3713,7 +3744,17 @@
...
@@ -3713,7 +3744,17 @@
contextLineEnter
.
append
(
"path"
)
contextLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classLine
)
.
attr
(
"class"
,
classLine
)
.
style
(
"opacity"
,
0
)
.
style
(
"opacity"
,
0
)
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
})
// Steps
contextLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classStep
)
.
style
(
"opacity"
,
0
)
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
.
style
(
"stroke"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
// Area
contextLineEnter
.
append
(
"path"
)
.
attr
(
"class"
,
classArea
)
.
style
(
"opacity"
,
orgAreaOpacity
)
.
style
(
"fill"
,
function
(
d
)
{
return
color
(
d
.
id
);
});
}
}
/*-- Show --*/
/*-- Show --*/
...
...
c3.min.js
View file @
200091ee
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