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
Evgeny
c3-closed
Commits
eab6b04d
Commit
eab6b04d
authored
Nov 20, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix point.show not to hide scatter plot - #732
parent
90387157
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
13 deletions
+57
-13
c3.js
c3.js
+2
-1
c3.min.js
c3.min.js
+0
-0
shape.line-spec.js
spec/shape.line-spec.js
+53
-11
core.js
src/core.js
+2
-1
No files found.
c3.js
View file @
eab6b04d
...
...
@@ -724,7 +724,8 @@
return
d
.
value
!==
null
&&
this
.
withoutFadeIn
[
d
.
id
]
?
this
.
opacityForCircle
(
d
)
:
0
;
};
c3_chart_internal_fn
.
opacityForCircle
=
function
(
d
)
{
return
isValue
(
d
.
value
)
&&
this
.
config
.
point_show
?
(
this
.
isScatterType
(
d
)
?
0.5
:
1
)
:
0
;
var
opacity
=
this
.
config
.
point_show
?
1
:
0
;
return
isValue
(
d
.
value
)
?
(
this
.
isScatterType
(
d
)
?
0.5
:
opacity
)
:
0
;
};
c3_chart_internal_fn
.
opacityForText
=
function
()
{
return
this
.
hasDataLabel
()
?
1
:
0
;
...
...
c3.min.js
View file @
eab6b04d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/shape.line-spec.js
View file @
eab6b04d
...
...
@@ -3,8 +3,6 @@ var describe = window.describe,
it
=
window
.
it
,
beforeEach
=
window
.
beforeEach
;
var
initDom
=
window
.
initDom
;
describe
(
'c3 chart shape line'
,
function
()
{
'use strict'
;
...
...
@@ -22,16 +20,8 @@ describe('c3 chart shape line', function () {
};
beforeEach
(
function
(
done
)
{
if
(
typeof
chart
===
'undefined'
)
{
initDom
();
}
chart
=
window
.
c3
.
generate
(
args
);
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
chart
.
internal
.
d3
.
select
(
'.jasmine_html-reporter'
).
style
(
'display'
,
'none'
);
window
.
setTimeout
(
function
()
{
done
();
},
10
);
});
describe
(
'shape-rendering for line chart'
,
function
()
{
...
...
@@ -57,4 +47,56 @@ describe('c3 chart shape line', function () {
});
describe
(
'point.show option'
,
function
()
{
it
(
'should change args to include null data'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
null
,
100
,
400
,
-
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
-
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'line'
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should not show the circle for null'
,
function
(
done
)
{
setTimeout
(
function
()
{
var
target
=
chart
.
internal
.
main
.
select
(
'.c3-chart-line.c3-target-data1'
);
expect
(
+
target
.
select
(
'.c3-circle-0'
).
style
(
'opacity'
)).
toBe
(
1
);
expect
(
+
target
.
select
(
'.c3-circle-1'
).
style
(
'opacity'
)).
toBe
(
0
);
expect
(
+
target
.
select
(
'.c3-circle-2'
).
style
(
'opacity'
)).
toBe
(
1
);
done
();
},
500
);
});
it
(
'should change args to include null data on scatter plot'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
null
,
100
,
400
,
-
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
],
[
'data3'
,
-
150
,
120
,
110
,
140
,
115
,
125
]
],
type
:
'scatter'
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should not show the circle for null'
,
function
(
done
)
{
setTimeout
(
function
()
{
var
target
=
chart
.
internal
.
main
.
select
(
'.c3-chart-line.c3-target-data1'
);
expect
(
+
target
.
select
(
'.c3-circle-0'
).
style
(
'opacity'
)).
toBe
(
0.5
);
expect
(
+
target
.
select
(
'.c3-circle-1'
).
style
(
'opacity'
)).
toBe
(
0
);
expect
(
+
target
.
select
(
'.c3-circle-2'
).
style
(
'opacity'
)).
toBe
(
0.5
);
done
();
},
500
);
});
});
});
src/core.js
View file @
eab6b04d
...
...
@@ -719,7 +719,8 @@ c3_chart_internal_fn.initialOpacityForCircle = function (d) {
return
d
.
value
!==
null
&&
this
.
withoutFadeIn
[
d
.
id
]
?
this
.
opacityForCircle
(
d
)
:
0
;
};
c3_chart_internal_fn
.
opacityForCircle
=
function
(
d
)
{
return
isValue
(
d
.
value
)
&&
this
.
config
.
point_show
?
(
this
.
isScatterType
(
d
)
?
0.5
:
1
)
:
0
;
var
opacity
=
this
.
config
.
point_show
?
1
:
0
;
return
isValue
(
d
.
value
)
?
(
this
.
isScatterType
(
d
)
?
0.5
:
opacity
)
:
0
;
};
c3_chart_internal_fn
.
opacityForText
=
function
()
{
return
this
.
hasDataLabel
()
?
1
:
0
;
...
...
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