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
a083af28
Commit
a083af28
authored
Aug 30, 2014
by
Christian Kalmar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resize the eventRect for single data points for tooltips to work
parent
140cf726
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
c3.js
c3.js
+15
-1
c3.min.js
c3.min.js
+0
-0
interaction.js
src/interaction.js
+15
-1
No files found.
c3.js
View file @
a083af28
...
@@ -2012,11 +2012,25 @@
...
@@ -2012,11 +2012,25 @@
rectW
=
function
(
d
)
{
rectW
=
function
(
d
)
{
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
nextX
=
$$
.
getNextX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
],
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
nextX
=
$$
.
getNextX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
],
w
=
(
$$
.
x
(
nextX
?
nextX
:
dx
)
-
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
w
=
(
$$
.
x
(
nextX
?
nextX
:
dx
)
-
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
// if there this is a single data point make the eventRect full width (or height)
if
(
prevX
===
null
&&
nextX
===
null
)
{
return
config
.
axis_rotated
?
$$
.
height
:
$$
.
width
;
}
else
{
return
w
<
0
?
0
:
w
;
return
w
<
0
?
0
:
w
;
}
};
};
rectX
=
function
(
d
)
{
rectX
=
function
(
d
)
{
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
];
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
nextX
=
$$
.
getNextX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
];
// if there this is a single data point position the eventRect at 0
if
(
prevX
===
null
&&
nextX
===
null
)
{
return
0
;
}
else
{
return
(
$$
.
x
(
dx
)
+
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
return
(
$$
.
x
(
dx
)
+
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
}
};
};
}
else
{
}
else
{
rectW
=
$$
.
getEventRectWidth
();
rectW
=
$$
.
getEventRectWidth
();
...
...
c3.min.js
View file @
a083af28
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/interaction.js
View file @
a083af28
...
@@ -62,11 +62,25 @@ c3_chart_internal_fn.updateEventRect = function (eventRectUpdate) {
...
@@ -62,11 +62,25 @@ c3_chart_internal_fn.updateEventRect = function (eventRectUpdate) {
rectW
=
function
(
d
)
{
rectW
=
function
(
d
)
{
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
nextX
=
$$
.
getNextX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
],
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
nextX
=
$$
.
getNextX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
],
w
=
(
$$
.
x
(
nextX
?
nextX
:
dx
)
-
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
w
=
(
$$
.
x
(
nextX
?
nextX
:
dx
)
-
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
// if there this is a single data point make the eventRect full width (or height)
if
(
prevX
===
null
&&
nextX
===
null
)
{
return
config
.
axis_rotated
?
$$
.
height
:
$$
.
width
;
}
else
{
return
w
<
0
?
0
:
w
;
return
w
<
0
?
0
:
w
;
}
};
};
rectX
=
function
(
d
)
{
rectX
=
function
(
d
)
{
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
];
var
prevX
=
$$
.
getPrevX
(
d
.
index
),
nextX
=
$$
.
getNextX
(
d
.
index
),
dx
=
$$
.
data
.
xs
[
d
.
id
][
d
.
index
];
// if there this is a single data point position the eventRect at 0
if
(
prevX
===
null
&&
nextX
===
null
)
{
return
0
;
}
else
{
return
(
$$
.
x
(
dx
)
+
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
return
(
$$
.
x
(
dx
)
+
$$
.
x
(
prevX
?
prevX
:
dx
))
/
2
;
}
};
};
}
else
{
}
else
{
rectW
=
$$
.
getEventRectWidth
();
rectW
=
$$
.
getEventRectWidth
();
...
...
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