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
e7f976df
Commit
e7f976df
authored
Nov 20, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dungsaga-master'
parents
34508a2d
1eedee35
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
13 deletions
+16
-13
c3.js
c3.js
+1
-1
c3.min.js
c3.min.js
+0
-0
api.data-spec.js
spec/api.data-spec.js
+14
-11
api.data.js
src/api.data.js
+1
-1
No files found.
c3.js
View file @
e7f976df
...
@@ -6246,7 +6246,7 @@
...
@@ -6246,7 +6246,7 @@
};
};
c3_chart_fn
.
data
.
values
=
function
(
targetId
)
{
c3_chart_fn
.
data
.
values
=
function
(
targetId
)
{
var
target
=
this
.
data
(
targetId
);
var
target
=
this
.
data
(
targetId
);
return
target
?
target
.
values
.
map
(
function
(
d
)
{
return
d
.
value
;
})
:
null
;
return
target
[
0
]
?
target
[
0
]
.
values
.
map
(
function
(
d
)
{
return
d
.
value
;
})
:
null
;
};
};
c3_chart_fn
.
data
.
names
=
function
(
names
)
{
c3_chart_fn
.
data
.
names
=
function
(
names
)
{
return
this
.
internal
.
updateDataAttributes
(
'names'
,
names
);
return
this
.
internal
.
updateDataAttributes
(
'names'
,
names
);
...
...
c3.min.js
View file @
e7f976df
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/api.data-spec.js
View file @
e7f976df
...
@@ -35,18 +35,8 @@ describe('c3 api data', function () {
...
@@ -35,18 +35,8 @@ describe('c3 api data', function () {
};
};
beforeEach
(
function
(
done
)
{
beforeEach
(
function
(
done
)
{
if
(
typeof
chart
===
'undefined'
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
window
.
initDom
();
}
chart
=
window
.
c3
.
generate
(
args
);
d3
=
chart
.
internal
.
d3
;
d3
=
chart
.
internal
.
d3
;
chart
.
internal
.
d3
.
select
(
'.jasmine_html-reporter'
)
.
style
(
'position'
,
'absolute'
)
.
style
(
'right'
,
0
);
window
.
setTimeout
(
function
()
{
done
();
},
10
);
});
});
describe
(
'data()'
,
function
()
{
describe
(
'data()'
,
function
()
{
...
@@ -86,6 +76,19 @@ describe('c3 api data', function () {
...
@@ -86,6 +76,19 @@ describe('c3 api data', function () {
});
});
describe
(
'data.values()'
,
function
()
{
it
(
'should return values for specified target'
,
function
()
{
var
values
=
chart
.
data
.
values
(
'data1'
),
expectedValues
=
[
30
,
200
,
100
,
400
,
150
,
250
];
expect
(
values
.
length
).
toBe
(
6
);
values
.
forEach
(
function
(
v
,
i
)
{
expect
(
v
).
toBe
(
expectedValues
[
i
]);
});
});
});
describe
(
'data.names()'
,
function
()
{
describe
(
'data.names()'
,
function
()
{
it
(
'should return data.names specified as argument'
,
function
()
{
it
(
'should return data.names specified as argument'
,
function
()
{
...
...
src/api.data.js
View file @
e7f976df
...
@@ -9,7 +9,7 @@ c3_chart_fn.data.shown = function (targetId) {
...
@@ -9,7 +9,7 @@ c3_chart_fn.data.shown = function (targetId) {
};
};
c3_chart_fn
.
data
.
values
=
function
(
targetId
)
{
c3_chart_fn
.
data
.
values
=
function
(
targetId
)
{
var
target
=
this
.
data
(
targetId
);
var
target
=
this
.
data
(
targetId
);
return
target
?
target
.
values
.
map
(
function
(
d
)
{
return
d
.
value
;
})
:
null
;
return
target
[
0
]
?
target
[
0
]
.
values
.
map
(
function
(
d
)
{
return
d
.
value
;
})
:
null
;
};
};
c3_chart_fn
.
data
.
names
=
function
(
names
)
{
c3_chart_fn
.
data
.
names
=
function
(
names
)
{
return
this
.
internal
.
updateDataAttributes
(
'names'
,
names
);
return
this
.
internal
.
updateDataAttributes
(
'names'
,
names
);
...
...
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