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
c478f1f8
Commit
c478f1f8
authored
Feb 23, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix x tick format
parent
cf583123
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
c3.js
c3.js
+12
-7
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
c478f1f8
...
@@ -134,15 +134,16 @@
...
@@ -134,15 +134,16 @@
// tooltip - show when mouseover on each data
// tooltip - show when mouseover on each data
var
__tooltip_enabled
=
getConfig
([
'tooltip'
,
'enabled'
],
true
),
var
__tooltip_enabled
=
getConfig
([
'tooltip'
,
'enabled'
],
true
),
__tooltip_contents
=
getConfig
([
'tooltip'
,
'contents'
],
function
(
d
)
{
__tooltip_contents
=
getConfig
([
'tooltip'
,
'contents'
],
function
(
d
)
{
var
title
=
getXAxisTickFormat
()(
d
[
0
].
x
),
var
yFormat
=
__axis_y_tick_format
?
__axis_y_tick_format
:
function
(
v
)
{
return
+
v
;
},
text
=
"<table class='-tooltip'><tr><th colspan='2'>"
+
title
+
"</th></tr>"
,
i
,
value
,
name
,
xFormat
=
getXAxisTickFormat
(),
format
=
__axis_y_tick_format
?
__axis_y_tick_format
:
function
(
v
)
{
return
+
v
;
};
title
=
xFormat
?
xFormat
(
d
[
0
].
x
)
:
d
[
0
].
x
,
text
=
"<table class='-tooltip'><tr><th colspan='2'>"
+
title
+
"</th></tr>"
,
i
,
value
,
name
;
for
(
i
=
0
;
i
<
d
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
d
.
length
;
i
++
)
{
if
(
!
d
[
i
]
||
!
isValue
(
d
[
i
].
value
))
{
continue
;
}
if
(
!
d
[
i
]
||
!
isValue
(
d
[
i
].
value
))
{
continue
;
}
value
=
'-'
;
value
=
'-'
;
if
(
isValue
(
d
[
i
].
value
))
{
if
(
isValue
(
d
[
i
].
value
))
{
value
=
f
ormat
(
d
[
i
].
value
);
value
=
yF
ormat
(
d
[
i
].
value
);
}
}
name
=
d
[
i
].
name
;
name
=
d
[
i
].
name
;
...
@@ -402,11 +403,15 @@
...
@@ -402,11 +403,15 @@
return
id
in
__data_axes
?
__data_axes
[
id
]
:
'y'
;
return
id
in
__data_axes
?
__data_axes
[
id
]
:
'y'
;
}
}
function
getXAxisTickFormat
()
{
function
getXAxisTickFormat
()
{
var
tickFormat
=
isTimeSeries
?
defaultTimeFormat
:
isCategorized
?
category
:
function
(
x
)
{
return
x
;
}
;
var
format
=
isTimeSeries
?
defaultTimeFormat
:
isCategorized
?
category
:
null
;
if
(
__axis_x_tick_format
)
{
if
(
__axis_x_tick_format
)
{
tickFormat
=
typeof
__axis_x_tick_format
===
'function'
?
__axis_x_tick_format
:
isTimeSeries
?
function
(
date
)
{
return
d3
.
time
.
format
(
__axis_x_tick_format
)(
date
);
}
:
tickFormat
;
if
(
typeof
__axis_x_tick_format
===
'function'
)
{
format
=
__axis_x_tick_format
;
}
else
if
(
isTimeSeries
)
{
format
=
function
(
date
)
{
return
d3
.
time
.
format
(
__axis_x_tick_format
)(
date
);
};
}
}
}
return
tickF
ormat
;
return
f
ormat
;
}
}
//-- Arc --//
//-- Arc --//
...
...
c3.min.js
View file @
c478f1f8
This diff is collapsed.
Click to expand it.
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