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
805b15a3
Commit
805b15a3
authored
Sep 01, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix data label position when brushed - #485
parent
9a5a6d62
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
6 deletions
+28
-6
c3.js
c3.js
+2
-2
c3.min.js
c3.min.js
+0
-0
subchart.html
htdocs/samples/subchart.html
+24
-2
text.js
src/text.js
+2
-2
No files found.
c3.js
View file @
805b15a3
...
...
@@ -2983,7 +2983,7 @@
}
else
{
xPos
=
$$
.
hasType
(
'bar'
)
?
(
points
[
2
][
0
]
+
points
[
0
][
0
])
/
2
:
points
[
0
][
0
];
}
return
xPos
>
$$
.
width
?
$$
.
width
-
box
.
width
:
xPos
;
return
d
.
value
!==
null
?
xPos
:
xPos
>
$$
.
width
?
$$
.
width
-
box
.
width
:
xPos
;
};
c3_chart_internal_fn
.
getYForText
=
function
(
points
,
d
,
textElement
)
{
var
$$
=
this
,
...
...
@@ -2993,7 +2993,7 @@
}
else
{
yPos
=
points
[
2
][
1
]
+
(
d
.
value
<
0
?
box
.
height
:
$$
.
isBarType
(
d
)
?
-
3
:
-
6
);
}
return
yPos
<
box
.
height
?
box
.
height
:
yPos
;
return
d
.
value
!==
null
?
yPos
:
yPos
<
box
.
height
?
box
.
height
:
yPos
;
};
c3_chart_internal_fn
.
setTargetType
=
function
(
targetIds
,
type
)
{
...
...
c3.min.js
View file @
805b15a3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
htdocs/samples/subchart.html
View file @
805b15a3
...
...
@@ -3,22 +3,44 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/c3.css"
>
</head>
<body>
<div
id=
"chart"
></div>
<div
id=
"chart1"
></div>
<div
id=
"chart2"
></div>
<script
src=
"http://d3js.org/d3.v3.min.js"
charset=
"utf-8"
></script>
<script
src=
"/js/c3.js"
></script>
<script>
var
chart
=
c3
.
generate
({
var
chart1
=
c3
.
generate
({
bindto
:
'#chart1'
,
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
]
],
labels
:
true
},
subchart
:
{
show
:
true
},
});
var
chart2
=
c3
.
generate
({
bindto
:
'#chart2'
,
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
]
],
labels
:
true
},
subchart
:
{
show
:
true
},
axis
:
{
rotated
:
true
}
});
</script>
</body>
</html>
src/text.js
View file @
805b15a3
...
...
@@ -77,7 +77,7 @@ c3_chart_internal_fn.getXForText = function (points, d, textElement) {
}
else
{
xPos
=
$$
.
hasType
(
'bar'
)
?
(
points
[
2
][
0
]
+
points
[
0
][
0
])
/
2
:
points
[
0
][
0
];
}
return
xPos
>
$$
.
width
?
$$
.
width
-
box
.
width
:
xPos
;
return
d
.
value
!==
null
?
xPos
:
xPos
>
$$
.
width
?
$$
.
width
-
box
.
width
:
xPos
;
};
c3_chart_internal_fn
.
getYForText
=
function
(
points
,
d
,
textElement
)
{
var
$$
=
this
,
...
...
@@ -87,5 +87,5 @@ c3_chart_internal_fn.getYForText = function (points, d, textElement) {
}
else
{
yPos
=
points
[
2
][
1
]
+
(
d
.
value
<
0
?
box
.
height
:
$$
.
isBarType
(
d
)
?
-
3
:
-
6
);
}
return
yPos
<
box
.
height
?
box
.
height
:
yPos
;
return
d
.
value
!==
null
?
yPos
:
yPos
<
box
.
height
?
box
.
height
:
yPos
;
};
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