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
30bd75fe
Commit
30bd75fe
authored
Apr 22, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add axis.x.show option - #135
parent
633ed3bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
c3.js
c3.js
+15
-11
c3.min.js
c3.min.js
+0
-0
No files found.
c3.js
View file @
30bd75fe
...
@@ -166,6 +166,7 @@
...
@@ -166,6 +166,7 @@
// axis
// axis
var
__axis_rotated
=
getConfig
([
'axis'
,
'rotated'
],
false
),
var
__axis_rotated
=
getConfig
([
'axis'
,
'rotated'
],
false
),
__axis_x_show
=
getConfig
([
'axis'
,
'x'
,
'show'
],
true
),
__axis_x_type
=
getConfig
([
'axis'
,
'x'
,
'type'
],
'indexed'
),
__axis_x_type
=
getConfig
([
'axis'
,
'x'
,
'type'
],
'indexed'
),
__axis_x_localtime
=
getConfig
([
'axis'
,
'x'
,
'localtime'
],
true
),
__axis_x_localtime
=
getConfig
([
'axis'
,
'x'
,
'localtime'
],
true
),
__axis_x_categories
=
getConfig
([
'axis'
,
'x'
,
'categories'
],
[]),
__axis_x_categories
=
getConfig
([
'axis'
,
'x'
,
'categories'
],
[]),
...
@@ -372,7 +373,7 @@
...
@@ -372,7 +373,7 @@
//-- Sizes --//
//-- Sizes --//
// TODO: configurabale
// TODO: configurabale
var
rotated_padding_left
=
30
,
rotated_padding_right
=
30
,
rotated_padding_top
=
5
;
var
rotated_padding_left
=
30
,
rotated_padding_right
=
__axis_rotated
&&
!
__axis_x_show
?
0
:
30
,
rotated_padding_top
=
5
;
function
updateSizes
()
{
function
updateSizes
()
{
var
legendHeight
=
getLegendHeight
(),
legendWidth
=
getLegendWidth
();
var
legendHeight
=
getLegendHeight
(),
legendWidth
=
getLegendWidth
();
...
@@ -474,6 +475,7 @@
...
@@ -474,6 +475,7 @@
return
position
.
isInner
?
20
+
getMaxTickWidth
(
id
)
:
40
+
getMaxTickWidth
(
id
);
return
position
.
isInner
?
20
+
getMaxTickWidth
(
id
)
:
40
+
getMaxTickWidth
(
id
);
}
}
function
getHorizontalAxisHeight
(
axisId
)
{
function
getHorizontalAxisHeight
(
axisId
)
{
if
(
axisId
===
'x'
&&
!
__axis_x_show
)
{
return
0
;
}
if
(
axisId
===
'y'
&&
!
__axis_y_show
)
{
return
__legend_show
&&
!
isLegendRight
?
10
:
1
;
}
if
(
axisId
===
'y'
&&
!
__axis_y_show
)
{
return
__legend_show
&&
!
isLegendRight
?
10
:
1
;
}
if
(
axisId
===
'y2'
&&
!
__axis_y2_show
)
{
return
rotated_padding_top
;
}
if
(
axisId
===
'y2'
&&
!
__axis_y2_show
)
{
return
rotated_padding_top
;
}
return
(
getAxisLabelPositionById
(
axisId
).
isInner
?
30
:
40
)
+
(
axisId
===
'y2'
?
-
10
:
0
);
return
(
getAxisLabelPositionById
(
axisId
).
isInner
?
30
:
40
)
+
(
axisId
===
'y2'
?
-
10
:
0
);
...
@@ -2524,16 +2526,18 @@
...
@@ -2524,16 +2526,18 @@
/*-- Main Region --*/
/*-- Main Region --*/
// Add Axis
// Add Axis
main
.
append
(
"g"
)
if
(
__axis_x_show
)
{
.
attr
(
"class"
,
CLASS
.
axisX
)
main
.
append
(
"g"
)
.
attr
(
"clip-path"
,
clipPathForXAxis
)
.
attr
(
"class"
,
CLASS
.
axisX
)
.
attr
(
"transform"
,
translate
.
x
)
.
attr
(
"clip-path"
,
clipPathForXAxis
)
.
append
(
"text"
)
.
attr
(
"transform"
,
translate
.
x
)
.
attr
(
"class"
,
CLASS
.
axisXLabel
)
.
append
(
"text"
)
.
attr
(
"transform"
,
__axis_rotated
?
"rotate(-90)"
:
""
)
.
attr
(
"class"
,
CLASS
.
axisXLabel
)
.
attr
(
"dx"
,
dxForXAxisLabel
)
.
attr
(
"transform"
,
__axis_rotated
?
"rotate(-90)"
:
""
)
.
attr
(
"dy"
,
dyForXAxisLabel
)
.
attr
(
"dx"
,
dxForXAxisLabel
)
.
style
(
"text-anchor"
,
textAnchorForXAxisLabel
);
.
attr
(
"dy"
,
dyForXAxisLabel
)
.
style
(
"text-anchor"
,
textAnchorForXAxisLabel
);
}
if
(
__axis_y_show
)
{
if
(
__axis_y_show
)
{
main
.
append
(
"g"
)
main
.
append
(
"g"
)
...
...
c3.min.js
View file @
30bd75fe
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