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
4e001ee4
Commit
4e001ee4
authored
Oct 29, 2016
by
Дмитрий Никулин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tick culling: always leave last text shown
parent
cb918fd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
c3.axis.js
src/c3.axis.js
+12
-2
No files found.
src/c3.axis.js
View file @
4e001ee4
...
...
@@ -113,6 +113,16 @@ function c3_axis(d3, params, $$) {
for
(
i
=
0
;
i
<
l
;
i
++
){
if
(
i
%
cullStep
){
if
(
i
===
l
-
1
){
// Last rectangle should always be present, so if this is last but one rect
// and last one should be culled, we remove this one instead of last
var
x
=
i
-
1
;
do
{
rects
[
x
]
=
null
;
x
--
;
}
while
(
x
>
0
&&
(
rects
[
x
]
===
null
||
hasIntersection
(
rects
[
i
],
rects
[
x
])));
break
;
}
rects
[
i
]
=
null
;
}
}
...
...
@@ -360,8 +370,8 @@ function c3_axis(d3, params, $$) {
var
textClass
=
'.c3-axis-'
+
axisId
+
' .tick'
;
var
textRects
=
text
.
data
().
map
(
function
(
data
)
{
var
rect
=
$$
.
getTextRect
(
textFormatted
(
data
),
textClass
);
// Sma
a
l additional padding between texts
rect
.
width
+=
10
;
// Sma
l
l additional padding between texts
rect
.
width
+=
2
;
return
rect
;
});
...
...
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