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
bb469770
Commit
bb469770
authored
Jan 27, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix load with custom x - #7
parent
b4661964
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
c3.js
c3.js
+9
-4
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
bb469770
...
@@ -465,7 +465,6 @@
...
@@ -465,7 +465,6 @@
}
}
return
new_rows
;
return
new_rows
;
}
}
function
convertColumnsToData
(
columns
)
{
function
convertColumnsToData
(
columns
)
{
var
new_rows
=
[],
i
,
j
,
key
;
var
new_rows
=
[],
i
,
j
,
key
;
for
(
i
=
0
;
i
<
columns
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
columns
.
length
;
i
++
)
{
...
@@ -481,7 +480,7 @@
...
@@ -481,7 +480,7 @@
}
}
function
convertDataToTargets
(
data
)
{
function
convertDataToTargets
(
data
)
{
var
ids
=
d3
.
keys
(
data
[
0
]).
filter
(
function
(
key
)
{
return
key
!==
__data_x
;
});
var
ids
=
d3
.
keys
(
data
[
0
]).
filter
(
function
(
key
)
{
return
key
!==
__data_x
;
});
var
targets
,
i
=
0
,
parsedDate
;
var
targets
,
i
ndex
,
parsedDate
;
// check __data_x is defined if timeseries
// check __data_x is defined if timeseries
if
(
isTimeSeries
&&
!
__data_x
)
{
if
(
isTimeSeries
&&
!
__data_x
)
{
...
@@ -489,6 +488,11 @@
...
@@ -489,6 +488,11 @@
return
[];
return
[];
}
}
if
(
isCustomX
&&
isUndefined
(
c3
.
data
.
x
))
{
c3
.
data
.
x
=
data
.
map
(
function
(
d
)
{
return
d
[
__data_x
];
});
}
index
=
0
;
data
.
forEach
(
function
(
d
)
{
data
.
forEach
(
function
(
d
)
{
if
(
isTimeSeries
)
{
if
(
isTimeSeries
)
{
if
(
!
(
__data_x
in
d
))
{
throw
Error
(
"'"
+
__data_x
+
"' must be included in data"
);
}
if
(
!
(
__data_x
in
d
))
{
throw
Error
(
"'"
+
__data_x
+
"' must be included in data"
);
}
...
@@ -497,13 +501,14 @@
...
@@ -497,13 +501,14 @@
d
.
x
=
parsedDate
;
d
.
x
=
parsedDate
;
}
}
else
if
(
isCustomX
)
{
else
if
(
isCustomX
)
{
d
.
x
=
d
[
__data_
x
];
d
.
x
=
isDefined
(
d
[
__data_x
])
?
d
[
__data_x
]
:
c3
.
data
.
x
[
inde
x
];
}
}
else
{
else
{
d
.
x
=
i
++
;
d
.
x
=
i
ndex
;
}
}
if
(
firstDate
===
null
)
{
firstDate
=
new
Date
(
d
.
x
);
}
if
(
firstDate
===
null
)
{
firstDate
=
new
Date
(
d
.
x
);
}
lastDate
=
new
Date
(
d
.
x
);
lastDate
=
new
Date
(
d
.
x
);
index
++
;
});
});
targets
=
ids
.
map
(
function
(
id
)
{
targets
=
ids
.
map
(
function
(
id
)
{
...
...
c3.min.js
View file @
bb469770
This diff is collapsed.
Click to expand it.
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