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
11fa684a
Commit
11fa684a
authored
Oct 21, 2015
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move lines
parent
ba260653
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
3 deletions
+61
-3
Gruntfile.coffee
Gruntfile.coffee
+1
-0
api.load.js
src/api.load.js
+7
-0
lines.js
src/lines.js
+3
-3
util.js
src/util.js
+50
-0
No files found.
Gruntfile.coffee
View file @
11fa684a
...
...
@@ -57,6 +57,7 @@ module.exports = (grunt) ->
'src/callbacks.js'
,
'src/class.js'
,
'src/util.js'
,
'src/lines.js'
,
'src/api.focus.js'
,
'src/api.title.js'
,
'src/api.show.js'
,
...
...
src/api.load.js
View file @
11fa684a
...
...
@@ -114,3 +114,10 @@ c3_chart_fn.getValue = function(id, i){
return
t
.
values
[
i
].
value
;
};
c3
.
chart
.
fn
.
update_x
=
function
(
x
){
var
$$
=
this
.
internal
;
$$
.
api
.
x
(
copyArray
(
x
));
$$
.
tuneAxis
();
};
src/lines.js
View file @
11fa684a
...
...
@@ -18,7 +18,7 @@ c3.chart.internal.fn.getLineCoordsForBar = function(center, order){
var
x1
,
x2
,
y1
,
y2
;
if
(
utils
.
isSub
(
$$
.
config
.
ed3Type
)){
if
(
isSub
(
$$
.
config
.
ed3Type
)){
$$
.
ed3Config
.
subBox
=
$$
.
getBox
(
$$
.
main
.
selectAll
(
".sub-chart .c3-chart-bars"
));
...
...
@@ -88,7 +88,7 @@ c3.chart.internal.fn.getLineCoordsForPie = function(center, order){
var
x1
,
x2
,
y1
,
y2
;
if
(
utils
.
isSub
(
$$
.
config
.
ed3Type
)){
if
(
isSub
(
$$
.
config
.
ed3Type
)){
if
(
!
$$
.
ed3Config
.
coords
)
return
;
...
...
@@ -189,7 +189,7 @@ c3.chart.internal.fn.redrawLines = function(){
line
=
main
.
selectAll
(
".lineForSubChart"
).
filter
(
function
(
d
,
i
){
return
i
===
0
;
});
}
center
=
$$
.
getCenter
(
main
.
selectAll
(
'.c3-chart'
));
var
center
=
$$
.
getCenter
(
main
.
selectAll
(
'.c3-chart'
));
var
coords
;
...
...
src/util.js
View file @
11fa684a
...
...
@@ -52,5 +52,55 @@ var isValue = c3_chart_internal_fn.isValue = function (v) {
},
toDegrees
=
function
(
radians
){
return
radians
*
(
180
/
Math
.
PI
);
},
isSub
=
function
(
type
){
if
(
!
type
){
return
false
;
}
return
type
.
indexOf
(
"sub"
)
>
-
1
;
},
copyObject
=
function
(
oldObj
){
var
newObj
=
{};
for
(
var
key
in
oldObj
){
if
(
oldObj
.
hasOwnProperty
(
key
)){
newObj
[
key
]
=
oldObj
[
key
];
}
}
return
newObj
;
},
copyArray
=
function
(
oldArray
){
var
newArray
=
[];
oldArray
.
forEach
(
function
(
elem
){
if
(
typeof
elem
===
'function'
){
newArray
.
push
(
copyFunction
(
elem
));
}
else
if
(
Array
.
isArray
(
elem
)){
newArray
.
push
(
copyArray
(
elem
));
}
else
if
(
typeof
elem
===
'object'
){
newArray
.
push
(
copyObject
(
elem
));
}
else
{
newArray
.
push
(
elem
);
}
});
return
newArray
;
},
copyFunction
=
function
(
oldFunction
){
var
cloneObj
=
oldFunction
;
if
(
oldFunction
.
__isClone
)
{
cloneObj
=
oldFunction
.
__clonedFrom
;
}
var
temp
=
function
()
{
return
cloneObj
.
apply
(
oldFunction
,
arguments
);
};
for
(
var
key
in
oldFunction
)
{
temp
[
key
]
=
oldFunction
[
key
];
}
temp
.
__isClone
=
true
;
temp
.
__clonedFrom
=
cloneObj
;
return
temp
;
};
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