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
3dad31a9
You need to sign in or sign up before continuing.
Commit
3dad31a9
authored
Nov 16, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tooltip when statcked chart with multiple xs - #719
parent
12f7c816
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
20 deletions
+28
-20
c3.js
c3.js
+14
-10
c3.min.js
c3.min.js
+0
-0
core.js
src/core.js
+5
-2
data.js
src/data.js
+4
-3
selection.js
src/selection.js
+2
-2
shape.line.js
src/shape.line.js
+3
-3
No files found.
c3.js
View file @
3dad31a9
...
...
@@ -590,9 +590,12 @@
if
(
$$
.
updateZoom
)
{
$$
.
updateZoom
();
}
}
// update circleY based on updated parameters
$$
.
updateCircleY
();
// generate circle x/y functions depending on updated params
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
generateCircleY
()
:
$$
.
circleX
).
bind
(
$$
);
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateCircleY
()
).
bind
(
$$
);
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleY
:
$$
.
circleX
).
bind
(
$$
);
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
circleY
).
bind
(
$$
);
// transition should be derived from one transition
d3
.
transition
().
duration
(
duration
).
each
(
function
()
{
...
...
@@ -1780,10 +1783,11 @@
};
c3_chart_internal_fn
.
dist
=
function
(
data
,
pos
)
{
var
$$
=
this
,
config
=
$$
.
config
,
yScale
=
$$
.
getAxisId
(
data
.
id
)
===
'y'
?
$$
.
y
:
$$
.
y2
,
xIndex
=
config
.
axis_rotated
?
1
:
0
,
yIndex
=
config
.
axis_rotated
?
0
:
1
;
return
Math
.
pow
(
$$
.
x
(
data
.
x
)
-
pos
[
xIndex
],
2
)
+
Math
.
pow
(
yScale
(
data
.
value
)
-
pos
[
yIndex
],
2
);
yIndex
=
config
.
axis_rotated
?
0
:
1
,
y
=
$$
.
circleY
(
data
,
data
.
index
),
x
=
$$
.
x
(
data
.
x
);
return
Math
.
pow
(
x
-
pos
[
xIndex
],
2
)
+
Math
.
pow
(
y
-
pos
[
yIndex
],
2
);
};
c3_chart_internal_fn
.
convertValuesToStep
=
function
(
values
)
{
var
converted
=
[].
concat
(
values
),
i
;
...
...
@@ -2935,16 +2939,16 @@
c3_chart_internal_fn
.
circleX
=
function
(
d
)
{
return
d
.
x
||
d
.
x
===
0
?
this
.
x
(
d
.
x
)
:
null
;
};
c3_chart_internal_fn
.
gener
ateCircleY
=
function
()
{
c3_chart_internal_fn
.
upd
ateCircleY
=
function
()
{
var
$$
=
this
,
lineIndices
,
getPoints
;
if
(
$$
.
config
.
data_groups
.
length
>
0
)
{
lineIndices
=
$$
.
getShapeIndices
(
$$
.
isLineType
),
getPoints
=
$$
.
generateGetLinePoints
(
lineIndices
);
return
function
(
d
,
i
)
{
$$
.
circleY
=
function
(
d
,
i
)
{
return
getPoints
(
d
,
i
)[
0
][
1
];
};
}
else
{
return
function
(
d
)
{
$$
.
circleY
=
function
(
d
)
{
return
$$
.
getYScale
(
d
.
id
)(
d
.
value
);
};
}
...
...
@@ -4928,8 +4932,8 @@
c3_chart_internal_fn
.
selectPoint
=
function
(
target
,
d
,
i
)
{
var
$$
=
this
,
config
=
$$
.
config
,
cx
=
(
config
.
axis_rotated
?
$$
.
generateC
ircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateC
ircleY
()).
bind
(
$$
),
cx
=
(
config
.
axis_rotated
?
$$
.
c
ircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
c
ircleY
()).
bind
(
$$
),
r
=
$$
.
pointSelectR
.
bind
(
$$
);
config
.
data_onselected
.
call
(
$$
.
api
,
d
,
target
.
node
());
// add selected-circle on low layer g
...
...
c3.min.js
View file @
3dad31a9
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/core.js
View file @
3dad31a9
...
...
@@ -585,9 +585,12 @@ c3_chart_internal_fn.redraw = function (options, transitions) {
if
(
$$
.
updateZoom
)
{
$$
.
updateZoom
();
}
}
// update circleY based on updated parameters
$$
.
updateCircleY
();
// generate circle x/y functions depending on updated params
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
generateCircleY
()
:
$$
.
circleX
).
bind
(
$$
);
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateCircleY
()
).
bind
(
$$
);
cx
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleY
:
$$
.
circleX
).
bind
(
$$
);
cy
=
(
$$
.
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
circleY
).
bind
(
$$
);
// transition should be derived from one transition
d3
.
transition
().
duration
(
duration
).
each
(
function
()
{
...
...
src/data.js
View file @
3dad31a9
...
...
@@ -319,10 +319,11 @@ c3_chart_internal_fn.findClosest = function (values, pos) {
};
c3_chart_internal_fn
.
dist
=
function
(
data
,
pos
)
{
var
$$
=
this
,
config
=
$$
.
config
,
yScale
=
$$
.
getAxisId
(
data
.
id
)
===
'y'
?
$$
.
y
:
$$
.
y2
,
xIndex
=
config
.
axis_rotated
?
1
:
0
,
yIndex
=
config
.
axis_rotated
?
0
:
1
;
return
Math
.
pow
(
$$
.
x
(
data
.
x
)
-
pos
[
xIndex
],
2
)
+
Math
.
pow
(
yScale
(
data
.
value
)
-
pos
[
yIndex
],
2
);
yIndex
=
config
.
axis_rotated
?
0
:
1
,
y
=
$$
.
circleY
(
data
,
data
.
index
),
x
=
$$
.
x
(
data
.
x
);
return
Math
.
pow
(
x
-
pos
[
xIndex
],
2
)
+
Math
.
pow
(
y
-
pos
[
yIndex
],
2
);
};
c3_chart_internal_fn
.
convertValuesToStep
=
function
(
values
)
{
var
converted
=
[].
concat
(
values
),
i
;
...
...
src/selection.js
View file @
3dad31a9
c3_chart_internal_fn
.
selectPoint
=
function
(
target
,
d
,
i
)
{
var
$$
=
this
,
config
=
$$
.
config
,
cx
=
(
config
.
axis_rotated
?
$$
.
generateC
ircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
generateC
ircleY
()).
bind
(
$$
),
cx
=
(
config
.
axis_rotated
?
$$
.
c
ircleY
()
:
$$
.
circleX
).
bind
(
$$
),
cy
=
(
config
.
axis_rotated
?
$$
.
circleX
:
$$
.
c
ircleY
()).
bind
(
$$
),
r
=
$$
.
pointSelectR
.
bind
(
$$
);
config
.
data_onselected
.
call
(
$$
.
api
,
d
,
target
.
node
());
// add selected-circle on low layer g
...
...
src/shape.line.js
View file @
3dad31a9
...
...
@@ -306,16 +306,16 @@ c3_chart_internal_fn.addTransitionForCircle = function (transitions, cx, cy) {
c3_chart_internal_fn
.
circleX
=
function
(
d
)
{
return
d
.
x
||
d
.
x
===
0
?
this
.
x
(
d
.
x
)
:
null
;
};
c3_chart_internal_fn
.
gener
ateCircleY
=
function
()
{
c3_chart_internal_fn
.
upd
ateCircleY
=
function
()
{
var
$$
=
this
,
lineIndices
,
getPoints
;
if
(
$$
.
config
.
data_groups
.
length
>
0
)
{
lineIndices
=
$$
.
getShapeIndices
(
$$
.
isLineType
),
getPoints
=
$$
.
generateGetLinePoints
(
lineIndices
);
return
function
(
d
,
i
)
{
$$
.
circleY
=
function
(
d
,
i
)
{
return
getPoints
(
d
,
i
)[
0
][
1
];
};
}
else
{
return
function
(
d
)
{
$$
.
circleY
=
function
(
d
)
{
return
$$
.
getYScale
(
d
.
id
)(
d
.
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