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
1987be65
Commit
1987be65
authored
Apr 03, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix x axis tick values
parent
809030ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
c3.js
c3.js
+9
-7
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
1987be65
...
...
@@ -624,7 +624,7 @@
return
id
in
__data_axes
?
__data_axes
[
id
]
:
'y'
;
}
function
getXAxisTickFormat
()
{
var
format
=
isTimeSeries
?
defaultTimeFormat
:
isCategorized
?
category
:
null
;
var
format
=
isTimeSeries
?
defaultTimeFormat
:
isCategorized
?
category
Name
:
function
(
v
)
{
return
v
<
0
?
v
.
toFixed
(
0
)
:
v
;
}
;
if
(
__axis_x_tick_format
)
{
if
(
typeof
__axis_x_tick_format
===
'function'
)
{
format
=
__axis_x_tick_format
;
...
...
@@ -1514,7 +1514,7 @@
function
hasPositiveValueInTargets
(
targets
)
{
return
checkValueInTargets
(
targets
,
function
(
v
)
{
return
v
>
0
;
});
}
function
category
(
i
)
{
function
category
Name
(
i
)
{
return
i
<
__axis_x_categories
.
length
?
__axis_x_categories
[
i
]
:
i
;
}
function
generateClass
(
prefix
,
targetId
)
{
...
...
@@ -2900,10 +2900,12 @@
if
(
withUpdateXDomain
)
{
x
.
domain
(
brush
.
empty
()
?
orgXDomain
:
brush
.
extent
());
if
(
__zoom_enabled
)
{
zoom
.
scale
(
x
).
updateScaleExtent
();
}
// update axis tick values according to options
tickValues
=
generateTickValues
(
mapTargetsToUniqueXs
(
targetsToShow
));
xAxis
.
tickValues
(
tickValues
);
subXAxis
.
tickValues
(
tickValues
);
// update axis tick values according to options, except for scatter plot
if
(
!
hasScatterType
(
targetsToShow
))
{
// TODO: fix this
tickValues
=
generateTickValues
(
mapTargetsToUniqueXs
(
targetsToShow
));
xAxis
.
tickValues
(
tickValues
);
subXAxis
.
tickValues
(
tickValues
);
}
}
y
.
domain
(
getYDomain
(
targetsToShow
,
'y'
));
y2
.
domain
(
getYDomain
(
targetsToShow
,
'y2'
));
...
...
@@ -2914,7 +2916,7 @@
main
.
select
(
'.'
+
CLASS
.
axisY2
).
style
(
"opacity"
,
hideAxis
?
0
:
1
).
transition
().
duration
(
durationForAxis
).
call
(
yAxis2
);
// show/hide if manual culling needed
if
(
withUpdateXDomain
&&
__axis_x_tick_culling
)
{
if
(
withUpdateXDomain
&&
__axis_x_tick_culling
&&
tickValues
)
{
for
(
i
=
1
;
i
<
tickValues
.
length
;
i
++
)
{
if
(
tickValues
.
length
/
i
<
__axis_x_tick_culling_max
)
{
intervalForCulling
=
i
;
...
...
c3.min.js
View file @
1987be65
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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