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
342feb4c
Commit
342feb4c
authored
Jul 04, 2016
by
Evgeny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add all marker types to config by default
parent
01626ef5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
77 additions
and
4 deletions
+77
-4
c3.js
c3.js
+15
-2
c3.min.js
c3.min.js
+0
-0
markers-spec.js
spec/markers-spec.js
+47
-0
config.js
src/config.js
+12
-2
marker.js
src/marker.js
+3
-0
No files found.
c3.js
View file @
342feb4c
...
@@ -1256,8 +1256,18 @@
...
@@ -1256,8 +1256,18 @@
// line
// line
line_connectNull
:
false
,
line_connectNull
:
false
,
line_step_type
:
'step'
,
line_step_type
:
'step'
,
marker_types
:
undefined
,
marker_types
:
{},
allMarkersTypes
:
[],
allMarkersTypes
:
[
'rhombus'
,
'square'
,
'triangle'
,
'cross'
,
'asterisk'
,
'circle'
,
'plus'
,
'serif'
,
'serifRight'
],
// bar
// bar
bar_width
:
undefined
,
bar_width
:
undefined
,
bar_width_ratio
:
0.6
,
bar_width_ratio
:
0.6
,
...
@@ -3417,6 +3427,9 @@
...
@@ -3417,6 +3427,9 @@
return
func
(
$$
.
pointR
(
d
,
i
),
$$
.
color
(
d
,
i
)).
node
();
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
){
c3_chart_fn
.
dataMarker
=
function
(
id
,
value
){
var
$$
=
this
.
internal
;
var
$$
=
this
.
internal
;
if
(
typeof
value
!==
'string'
)
{
if
(
typeof
value
!==
'string'
)
{
...
...
c3.min.js
View file @
342feb4c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/markers-spec.js
0 → 100644
View file @
342feb4c
describe
(
'c3 markers'
,
function
()
{
'use strict'
;
var
chart
,
d3
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
150
,
120
,
110
,
140
,
115
,
125
]
]
},
type
:
'line'
};
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
describe
(
'#setMarkers'
,
function
(){
it
(
'should set marker visible'
,
function
(){
chart
.
internal
.
setMarker
(
'data1'
);
expect
(
chart
.
internal
.
config
.
point_show
[
'data1'
]).
toBe
(
true
);
});
it
(
'should set different types of markers'
,
function
(){
var
allMarkers
=
chart
.
internal
.
config
.
allMarkersTypes
;
for
(
var
i
=
0
;
i
<
allMarkers
.
length
;
i
++
){
chart
.
internal
.
setMarker
(
'data'
+
i
);
expect
(
chart
.
internal
.
config
.
point_show
[
'data'
+
i
]).
toBe
(
true
);
expect
(
chart
.
internal
.
config
.
marker_types
[
'data'
+
i
]).
toBe
(
allMarkers
[
i
]);
}
chart
.
internal
.
setMarker
(
'data'
+
allMarkers
.
length
);
expect
(
chart
.
internal
.
config
.
point_show
[
'data'
+
allMarkers
.
length
]).
toBe
(
true
);
expect
(
chart
.
internal
.
config
.
marker_types
[
'data'
+
allMarkers
.
length
]).
toBe
(
allMarkers
[
0
]);
});
});
});
src/config.js
View file @
342feb4c
...
@@ -151,8 +151,18 @@ c3_chart_internal_fn.getDefaultConfig = function () {
...
@@ -151,8 +151,18 @@ c3_chart_internal_fn.getDefaultConfig = function () {
// line
// line
line_connectNull
:
false
,
line_connectNull
:
false
,
line_step_type
:
'step'
,
line_step_type
:
'step'
,
marker_types
:
undefined
,
marker_types
:
{},
allMarkersTypes
:
[],
allMarkersTypes
:
[
'rhombus'
,
'square'
,
'triangle'
,
'cross'
,
'asterisk'
,
'circle'
,
'plus'
,
'serif'
,
'serifRight'
],
// bar
// bar
bar_width
:
undefined
,
bar_width
:
undefined
,
bar_width_ratio
:
0.6
,
bar_width_ratio
:
0.6
,
...
...
src/marker.js
View file @
342feb4c
...
@@ -148,6 +148,9 @@ c3_chart_internal_fn.getMarker = function(d, i){
...
@@ -148,6 +148,9 @@ c3_chart_internal_fn.getMarker = function(d, i){
return
func
(
$$
.
pointR
(
d
,
i
),
$$
.
color
(
d
,
i
)).
node
();
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
){
c3_chart_fn
.
dataMarker
=
function
(
id
,
value
){
var
$$
=
this
.
internal
;
var
$$
=
this
.
internal
;
if
(
typeof
value
!==
'string'
)
{
if
(
typeof
value
!==
'string'
)
{
...
...
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