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
198d16f7
Commit
198d16f7
authored
Nov 14, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sub y extent when default extent set
parent
81b8d10d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
4 deletions
+63
-4
c3.js
c3.js
+4
-2
c3.min.js
c3.min.js
+0
-0
zoom-spec.js
spec/zoom-spec.js
+55
-0
core.js
src/core.js
+4
-2
No files found.
c3.js
View file @
198d16f7
...
...
@@ -534,8 +534,10 @@
yForText
=
$$
.
generateXYForText
(
areaIndices
,
barIndices
,
lineIndices
,
false
);
// Update sub domain
$$
.
subY
.
domain
(
$$
.
y
.
domain
());
$$
.
subY2
.
domain
(
$$
.
y2
.
domain
());
if
(
withY
)
{
$$
.
subY
.
domain
(
$$
.
getYDomain
(
targetsToShow
,
'y'
));
$$
.
subY2
.
domain
(
$$
.
getYDomain
(
targetsToShow
,
'y2'
));
}
// tooltip
$$
.
tooltip
.
style
(
"display"
,
"none"
);
...
...
c3.min.js
View file @
198d16f7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
spec/zoom-spec.js
0 → 100644
View file @
198d16f7
var
describe
=
window
.
describe
,
expect
=
window
.
expect
,
it
=
window
.
it
,
beforeEach
=
window
.
beforeEach
;
describe
(
'c3 chart zoom'
,
function
()
{
'use strict'
;
var
chart
,
d3
;
var
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
3150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
6025
]
]
},
axis
:
{
x
:
{
extent
:
[
1
,
2
]
}
},
zoom
:
{
enable
:
true
},
subchart
:
{
show
:
true
}
};
beforeEach
(
function
(
done
)
{
chart
=
window
.
initChart
(
chart
,
args
,
done
);
d3
=
chart
.
internal
.
d3
;
});
describe
(
'default extent'
,
function
()
{
it
(
'should have default extent'
,
function
()
{
var
yDomain
=
chart
.
internal
.
y
.
domain
(),
subYDomain
=
chart
.
internal
.
subY
.
domain
(),
brushExtent
=
chart
.
internal
.
brush
.
extent
(),
expectedYDomain
=
[
-
9
,
219
],
expectedSubYDomain
=
[
-
591.5
,
6626.5
],
expectedBrushExtent
=
[
1
,
2
];
expect
(
yDomain
[
0
]).
toBe
(
expectedYDomain
[
0
]);
expect
(
yDomain
[
1
]).
toBe
(
expectedYDomain
[
1
]);
expect
(
subYDomain
[
0
]).
toBe
(
expectedSubYDomain
[
0
]);
expect
(
subYDomain
[
1
]).
toBe
(
expectedSubYDomain
[
1
]);
expect
(
brushExtent
[
0
]).
toBe
(
expectedBrushExtent
[
0
]);
expect
(
brushExtent
[
1
]).
toBe
(
expectedBrushExtent
[
1
]);
});
});
});
src/core.js
View file @
198d16f7
...
...
@@ -529,8 +529,10 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
yForText
=
$$
.
generateXYForText
(
areaIndices
,
barIndices
,
lineIndices
,
false
);
// Update sub domain
$$
.
subY
.
domain
(
$$
.
y
.
domain
());
$$
.
subY2
.
domain
(
$$
.
y2
.
domain
());
if
(
withY
)
{
$$
.
subY
.
domain
(
$$
.
getYDomain
(
targetsToShow
,
'y'
));
$$
.
subY2
.
domain
(
$$
.
getYDomain
(
targetsToShow
,
'y2'
));
}
// tooltip
$$
.
tooltip
.
style
(
"display"
,
"none"
);
...
...
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