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
5affb553
Commit
5affb553
authored
Jul 08, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend marker functionality. Remove unused method
parent
f3873bbc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
30 deletions
+30
-30
c3.js
c3.js
+15
-15
c3.min.js
c3.min.js
+0
-0
marker.js
src/marker.js
+15
-15
No files found.
c3.js
View file @
5affb553
...
...
@@ -3410,9 +3410,14 @@
if
(
$$
.
currentMarkerTypeId
===
undefined
){
var
length
=
0
;
for
(
var
_
in
$$
.
config
.
marker_types
){
// TODO better counting
// If some markers are set manually, this will not produce
// best auto markers
for
(
var
_type
in
$$
.
config
.
marker_types
){
if
(
$$
.
config
.
marker_types
[
_type
]
!==
null
){
length
++
;
}
}
$$
.
currentMarkerTypeId
=
length
%
$$
.
config
.
allMarkersTypes
.
length
;
}
...
...
@@ -3441,7 +3446,15 @@
c3_chart_internal_fn
.
getMarker
=
function
(
d
,
i
){
var
$$
=
this
;
if
(
!
$$
.
config
.
marker_types
||
!
$$
.
config
.
marker_types
[
d
.
id
]){
// Null is special case when user wants to set marker
// but doesn't care which one. Then marker will be set automaticly, trying to choose the best one
// for each id
if
(
$$
.
config
.
point_show
[
d
.
id
]
&&
$$
.
config
.
marker_types
[
d
.
id
]
===
null
){
$$
.
setMarker
(
d
.
id
);
}
// If marker type isn't set at all, draw circle
if
(
$$
.
config
.
marker_types
[
d
.
id
]
===
undefined
){
return
marker_fn
.
circle
(
$$
.
pointR
(
d
,
i
)).
node
();
}
...
...
@@ -3450,19 +3463,6 @@
return
func
(
$$
.
pointR
(
d
,
i
),
$$
.
color
(
d
,
i
)).
node
();
};
// c3_chart_internal.setMarker is probably extended version of this
// If so, this need to be deleted and all tests for it rewriten using setMarker
c3_chart_fn
.
dataMarker
=
function
(
id
,
value
){
var
$$
=
this
.
internal
;
if
(
typeof
value
!==
'string'
)
{
return
$$
.
config
.
marker_types
[
id
];
}
if
(
$$
.
config
.
marker_types
[
id
]
!==
value
){
$$
.
config
.
marker_types
[
id
]
=
value
;
}
};
c3_chart_internal_fn
.
initBar
=
function
()
{
var
$$
=
this
;
$$
.
main
.
select
(
'.'
+
CLASS
.
chart
).
append
(
"g"
)
...
...
c3.min.js
View file @
5affb553
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/marker.js
View file @
5affb553
...
...
@@ -117,9 +117,14 @@ c3_chart_internal_fn.setMarker = function(id, type){
if
(
$$
.
currentMarkerTypeId
===
undefined
){
var
length
=
0
;
for
(
var
_
in
$$
.
config
.
marker_types
){
// TODO better counting
// If some markers are set manually, this will not produce
// best auto markers
for
(
var
_type
in
$$
.
config
.
marker_types
){
if
(
$$
.
config
.
marker_types
[
_type
]
!==
null
){
length
++
;
}
}
$$
.
currentMarkerTypeId
=
length
%
$$
.
config
.
allMarkersTypes
.
length
;
}
...
...
@@ -148,7 +153,15 @@ c3_chart_fn.getMarkerType = function(id){
c3_chart_internal_fn
.
getMarker
=
function
(
d
,
i
){
var
$$
=
this
;
if
(
!
$$
.
config
.
marker_types
||
!
$$
.
config
.
marker_types
[
d
.
id
]){
// Null is special case when user wants to set marker
// but doesn't care which one. Then marker will be set automaticly, trying to choose the best one
// for each id
if
(
$$
.
config
.
point_show
[
d
.
id
]
&&
$$
.
config
.
marker_types
[
d
.
id
]
===
null
){
$$
.
setMarker
(
d
.
id
);
}
// If marker type isn't set at all, draw circle
if
(
$$
.
config
.
marker_types
[
d
.
id
]
===
undefined
){
return
marker_fn
.
circle
(
$$
.
pointR
(
d
,
i
)).
node
();
}
...
...
@@ -156,16 +169,3 @@ c3_chart_internal_fn.getMarker = function(d, i){
return
func
(
$$
.
pointR
(
d
,
i
),
$$
.
color
(
d
,
i
)).
node
();
};
// c3_chart_internal.setMarker is probably extended version of this
// If so, this need to be deleted and all tests for it rewriten using setMarker
c3_chart_fn
.
dataMarker
=
function
(
id
,
value
){
var
$$
=
this
.
internal
;
if
(
typeof
value
!==
'string'
)
{
return
$$
.
config
.
marker_types
[
id
];
}
if
(
$$
.
config
.
marker_types
[
id
]
!==
value
){
$$
.
config
.
marker_types
[
id
]
=
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