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
4fe2f2fb
Commit
4fe2f2fb
authored
Oct 14, 2015
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up setValue and getValue
parent
6d8eaefa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
api.load.js
src/api.load.js
+12
-15
No files found.
src/api.load.js
View file @
4fe2f2fb
c3_chart_fn
.
load
=
function
(
args
)
{
var
$$
=
this
.
internal
,
config
=
$$
.
config
;
$$
.
config
.
turned
=
false
;
// update xs if specified
if
(
args
.
xs
)
{
$$
.
addXs
(
args
.
xs
);
...
...
@@ -87,33 +90,27 @@ c3_chart_fn.loadColumns = function(cols){
c3_chart_fn
.
setValue
=
function
(
id
,
i
,
value
){
var
$$
=
this
.
internal
;
var
column
=
$$
.
api
.
getDataById
(
id
);
if
(
isUndefined
(
column
)){
throw
new
Error
(
"Setting value to non-existing sequence "
+
id
);
}
var
t
=
$$
.
api
.
data
(
id
)[
0
];
if
(
isUndefined
(
column
[
i
])
){
if
(
!
t
.
values
[
i
]
){
$$
.
api
.
appendToColumn
([
id
,
value
]);
}
else
{
column
[
i
]
=
value
;
$$
.
api
.
loadColumns
([[
id
].
concat
(
column
)]
);
t
.
values
[
i
].
value
=
value
;
$$
.
tuneAxis
(
);
}
};
c3_chart_fn
.
getValue
=
function
(
id
,
i
){
var
$$
=
this
.
internal
;
var
column
=
$$
.
api
.
getDataById
(
id
);
if
(
isUndefined
(
column
)){
var
t
=
$$
.
api
.
data
(
id
)[
0
];
if
(
!
t
){
return
undefined
;
}
var
v
=
column
[
i
];
if
(
isUndefined
(
v
)){
if
(
!
t
.
values
[
i
]){
return
undefined
;
}
return
t
.
values
[
i
].
value
;
return
v
.
value
;
};
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