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
d3687dc0
Commit
d3687dc0
authored
Nov 08, 2015
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problem with update stacked-100 charts
parent
bee04927
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
0 deletions
+70
-0
c3.js
c3.js
+35
-0
c3.min.js
c3.min.js
+0
-0
core.js
src/core.js
+28
-0
shape.bar.js
src/shape.bar.js
+1
-0
shape.line.js
src/shape.line.js
+6
-0
No files found.
c3.js
View file @
d3687dc0
...
...
@@ -1177,6 +1177,34 @@
return
parsedDate
;
};
c3_chart_internal_fn
.
updateValues
=
function
(
d
){
var
$$
=
this
;
var
values
;
$$
.
data
.
targets
.
forEach
(
function
(
t
){
if
(
t
.
id
===
d
.
id
){
values
=
t
.
values
;
}
});
return
values
;
};
c3_chart_internal_fn
.
updateValue
=
function
(
d
){
var
$$
=
this
;
var
values
;
$$
.
data
.
targets
.
forEach
(
function
(
t
){
if
(
t
.
id
===
d
.
id
){
values
=
t
.
values
;
}
});
if
(
values
&&
values
[
d
.
x
]){
return
values
[
d
.
x
].
value
}
return
undefined
;
};
c3_chart_internal_fn
.
getDefaultConfig
=
function
()
{
var
config
=
{
bindto
:
'#chart'
,
...
...
@@ -3009,6 +3037,9 @@
return
function
(
d
)
{
var
values
=
config
.
line_connectNull
?
$$
.
filterRemoveNull
(
d
.
values
)
:
d
.
values
,
x
=
isSub
?
$$
.
x
:
$$
.
subX
,
y
=
yScaleGetter
.
call
(
$$
,
d
.
id
),
x0
=
0
,
y0
=
0
,
path
;
values
=
$$
.
updateValues
(
d
)
||
values
;
if
(
$$
.
isLineType
(
d
))
{
if
(
config
.
data_regions
[
d
.
id
])
{
path
=
$$
.
lineWithRegions
(
values
,
x
,
y
,
config
.
data_regions
[
d
.
id
]);
...
...
@@ -3174,6 +3205,9 @@
return
function
(
d
)
{
var
values
=
config
.
line_connectNull
?
$$
.
filterRemoveNull
(
d
.
values
)
:
d
.
values
,
x0
=
0
,
y0
=
0
,
path
;
values
=
$$
.
updateValues
(
d
)
||
values
;
if
(
$$
.
isAreaType
(
d
))
{
if
(
$$
.
isStepType
(
d
))
{
values
=
$$
.
convertValuesToStep
(
values
);
}
path
=
area
.
interpolate
(
$$
.
getInterpolate
(
d
))(
values
);
...
...
@@ -3398,6 +3432,7 @@
barOffset
=
$$
.
getShapeOffset
(
$$
.
isBarType
,
barIndices
,
!!
isSub
),
yScale
=
isSub
?
$$
.
getSubYScale
:
$$
.
getYScale
;
return
function
(
d
,
i
)
{
d
.
value
=
$$
.
updateValue
(
d
)
||
d
.
value
;
var
y0
=
yScale
.
call
(
$$
,
d
.
id
)(
0
),
offset
=
barOffset
(
d
,
i
)
||
y0
,
// offset is for stacked bar chart
posX
=
barX
(
d
),
posY
=
barY
(
d
);
...
...
c3.min.js
View file @
d3687dc0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/core.js
View file @
d3687dc0
...
...
@@ -955,3 +955,31 @@ c3_chart_internal_fn.parseDate = function (date) {
}
return
parsedDate
;
};
c3_chart_internal_fn
.
updateValues
=
function
(
d
){
var
$$
=
this
;
var
values
;
$$
.
data
.
targets
.
forEach
(
function
(
t
){
if
(
t
.
id
===
d
.
id
){
values
=
t
.
values
;
}
});
return
values
;
};
c3_chart_internal_fn
.
updateValue
=
function
(
d
){
var
$$
=
this
;
var
values
;
$$
.
data
.
targets
.
forEach
(
function
(
t
){
if
(
t
.
id
===
d
.
id
){
values
=
t
.
values
;
}
});
if
(
values
&&
values
[
d
.
x
]){
return
values
[
d
.
x
].
value
}
return
undefined
;
};
src/shape.bar.js
View file @
d3687dc0
...
...
@@ -96,6 +96,7 @@ c3_chart_internal_fn.generateGetBarPoints = function (barIndices, isSub) {
barOffset
=
$$
.
getShapeOffset
(
$$
.
isBarType
,
barIndices
,
!!
isSub
),
yScale
=
isSub
?
$$
.
getSubYScale
:
$$
.
getYScale
;
return
function
(
d
,
i
)
{
d
.
value
=
$$
.
updateValue
(
d
)
||
d
.
value
;
var
y0
=
yScale
.
call
(
$$
,
d
.
id
)(
0
),
offset
=
barOffset
(
d
,
i
)
||
y0
,
// offset is for stacked bar chart
posX
=
barX
(
d
),
posY
=
barY
(
d
);
...
...
src/shape.line.js
View file @
d3687dc0
...
...
@@ -77,6 +77,9 @@ c3_chart_internal_fn.generateDrawLine = function (lineIndices, isSub) {
return
function
(
d
)
{
var
values
=
config
.
line_connectNull
?
$$
.
filterRemoveNull
(
d
.
values
)
:
d
.
values
,
x
=
isSub
?
$$
.
x
:
$$
.
subX
,
y
=
yScaleGetter
.
call
(
$$
,
d
.
id
),
x0
=
0
,
y0
=
0
,
path
;
values
=
$$
.
updateValues
(
d
)
||
values
;
if
(
$$
.
isLineType
(
d
))
{
if
(
config
.
data_regions
[
d
.
id
])
{
path
=
$$
.
lineWithRegions
(
values
,
x
,
y
,
config
.
data_regions
[
d
.
id
]);
...
...
@@ -242,6 +245,9 @@ c3_chart_internal_fn.generateDrawArea = function (areaIndices, isSub) {
return
function
(
d
)
{
var
values
=
config
.
line_connectNull
?
$$
.
filterRemoveNull
(
d
.
values
)
:
d
.
values
,
x0
=
0
,
y0
=
0
,
path
;
values
=
$$
.
updateValues
(
d
)
||
values
;
if
(
$$
.
isAreaType
(
d
))
{
if
(
$$
.
isStepType
(
d
))
{
values
=
$$
.
convertValuesToStep
(
values
);
}
path
=
area
.
interpolate
(
$$
.
getInterpolate
(
d
))(
values
);
...
...
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