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
9416914e
Commit
9416914e
authored
Nov 20, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix empty data when timeseries - #737
parent
de502600
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
8 deletions
+57
-8
c3.js
c3.js
+6
-4
c3.min.js
c3.min.js
+0
-0
core-spec.js
spec/core-spec.js
+45
-0
data.js
src/data.js
+6
-4
No files found.
c3.js
View file @
9416914e
...
...
@@ -1576,10 +1576,12 @@
};
c3_chart_internal_fn
.
updateXs
=
function
()
{
var
$$
=
this
;
$$
.
xs
=
[];
$$
.
data
.
targets
[
0
].
values
.
forEach
(
function
(
v
)
{
$$
.
xs
[
v
.
index
]
=
v
.
x
;
});
if
(
$$
.
data
.
targets
.
length
)
{
$$
.
xs
=
[];
$$
.
data
.
targets
[
0
].
values
.
forEach
(
function
(
v
)
{
$$
.
xs
[
v
.
index
]
=
v
.
x
;
});
}
};
c3_chart_internal_fn
.
getPrevX
=
function
(
i
)
{
var
x
=
this
.
xs
[
i
-
1
];
...
...
c3.min.js
View file @
9416914e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/core-spec.js
View file @
9416914e
...
...
@@ -70,4 +70,49 @@ describe('c3 chart', function () {
});
describe
(
'empty data'
,
function
()
{
it
(
'should upaate args for empty data'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
],
[
'data2'
]
]
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should generate a chart'
,
function
()
{
var
ticks
=
chart
.
internal
.
main
.
select
(
'.c3-axis-x'
).
selectAll
(
'g.tick'
);
expect
(
ticks
.
size
()).
toBe
(
0
);
});
it
(
'should upaate args for empty data'
,
function
()
{
args
=
{
data
:
{
x
:
'x'
,
columns
:
[
[
'x'
],
[
'data1'
],
[
'data2'
]
]
},
axis
:
{
x
:
{
type
:
'timeseries'
}
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should generate a chart'
,
function
()
{
var
ticks
=
chart
.
internal
.
main
.
select
(
'.c3-axis-x'
).
selectAll
(
'g.tick'
);
expect
(
ticks
.
size
()).
toBe
(
0
);
});
});
});
src/data.js
View file @
9416914e
...
...
@@ -102,10 +102,12 @@ c3_chart_internal_fn.cloneTarget = function (target) {
};
c3_chart_internal_fn
.
updateXs
=
function
()
{
var
$$
=
this
;
$$
.
xs
=
[];
$$
.
data
.
targets
[
0
].
values
.
forEach
(
function
(
v
)
{
$$
.
xs
[
v
.
index
]
=
v
.
x
;
});
if
(
$$
.
data
.
targets
.
length
)
{
$$
.
xs
=
[];
$$
.
data
.
targets
[
0
].
values
.
forEach
(
function
(
v
)
{
$$
.
xs
[
v
.
index
]
=
v
.
x
;
});
}
};
c3_chart_internal_fn
.
getPrevX
=
function
(
i
)
{
var
x
=
this
.
xs
[
i
-
1
];
...
...
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