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
4f35d8f5
Commit
4f35d8f5
authored
Jan 18, 2015
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add axis.y.inverted and axis.y2.inverted - #885 #534
parent
82ba2a97
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
c3.js
c3.js
+6
-2
c3.min.js
c3.min.js
+0
-0
config.js
src/config.js
+2
-0
domain.js
src/domain.js
+4
-2
No files found.
c3.js
View file @
4f35d8f5
...
...
@@ -1059,6 +1059,7 @@
axis_y_type
:
undefined
,
axis_y_max
:
undefined
,
axis_y_min
:
undefined
,
axis_y_inverted
:
false
,
axis_y_center
:
undefined
,
axis_y_inner
:
undefined
,
axis_y_label
:
{},
...
...
@@ -1073,6 +1074,7 @@
axis_y2_show
:
false
,
axis_y2_max
:
undefined
,
axis_y2_min
:
undefined
,
axis_y2_inverted
:
false
,
axis_y2_center
:
undefined
,
axis_y2_inner
:
undefined
,
axis_y2_label
:
{},
...
...
@@ -1341,10 +1343,11 @@
yMax
=
axisId
===
'y2'
?
config
.
axis_y2_max
:
config
.
axis_y_max
,
yDomainMin
=
$$
.
getYDomainMin
(
yTargets
),
yDomainMax
=
$$
.
getYDomainMax
(
yTargets
),
domainLength
,
padding
,
padding_top
,
padding_bottom
,
domain
,
domain
Length
,
padding
,
padding_top
,
padding_bottom
,
center
=
axisId
===
'y2'
?
config
.
axis_y2_center
:
config
.
axis_y_center
,
yDomainAbs
,
lengths
,
diff
,
ratio
,
isAllPositive
,
isAllNegative
,
isZeroBased
=
(
$$
.
hasType
(
'bar'
,
yTargets
)
&&
config
.
bar_zerobased
)
||
(
$$
.
hasType
(
'area'
,
yTargets
)
&&
config
.
area_zerobased
),
isInverted
=
axisId
===
'y2'
?
config
.
axis_y2_inverted
:
config
.
axis_y_inverted
,
showHorizontalDataLabel
=
$$
.
hasDataLabel
()
&&
config
.
axis_rotated
,
showVerticalDataLabel
=
$$
.
hasDataLabel
()
&&
!
config
.
axis_rotated
;
...
...
@@ -1411,7 +1414,8 @@
if
(
isAllPositive
)
{
padding_bottom
=
yDomainMin
;
}
if
(
isAllNegative
)
{
padding_top
=
-
yDomainMax
;
}
}
return
[
yDomainMin
-
padding_bottom
,
yDomainMax
+
padding_top
];
domain
=
[
yDomainMin
-
padding_bottom
,
yDomainMax
+
padding_top
];
return
isInverted
?
domain
.
reverse
()
:
domain
;
};
c3_chart_internal_fn
.
getXDomainMin
=
function
(
targets
)
{
var
$$
=
this
,
config
=
$$
.
config
;
...
...
c3.min.js
View file @
4f35d8f5
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/config.js
View file @
4f35d8f5
...
...
@@ -105,6 +105,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
axis_y_type
:
undefined
,
axis_y_max
:
undefined
,
axis_y_min
:
undefined
,
axis_y_inverted
:
false
,
axis_y_center
:
undefined
,
axis_y_inner
:
undefined
,
axis_y_label
:
{},
...
...
@@ -119,6 +120,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
axis_y2_show
:
false
,
axis_y2_max
:
undefined
,
axis_y2_min
:
undefined
,
axis_y2_inverted
:
false
,
axis_y2_center
:
undefined
,
axis_y2_inner
:
undefined
,
axis_y2_label
:
{},
...
...
src/domain.js
View file @
4f35d8f5
...
...
@@ -68,10 +68,11 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
yMax
=
axisId
===
'y2'
?
config
.
axis_y2_max
:
config
.
axis_y_max
,
yDomainMin
=
$$
.
getYDomainMin
(
yTargets
),
yDomainMax
=
$$
.
getYDomainMax
(
yTargets
),
domainLength
,
padding
,
padding_top
,
padding_bottom
,
domain
,
domain
Length
,
padding
,
padding_top
,
padding_bottom
,
center
=
axisId
===
'y2'
?
config
.
axis_y2_center
:
config
.
axis_y_center
,
yDomainAbs
,
lengths
,
diff
,
ratio
,
isAllPositive
,
isAllNegative
,
isZeroBased
=
(
$$
.
hasType
(
'bar'
,
yTargets
)
&&
config
.
bar_zerobased
)
||
(
$$
.
hasType
(
'area'
,
yTargets
)
&&
config
.
area_zerobased
),
isInverted
=
axisId
===
'y2'
?
config
.
axis_y2_inverted
:
config
.
axis_y_inverted
,
showHorizontalDataLabel
=
$$
.
hasDataLabel
()
&&
config
.
axis_rotated
,
showVerticalDataLabel
=
$$
.
hasDataLabel
()
&&
!
config
.
axis_rotated
;
...
...
@@ -138,7 +139,8 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
if
(
isAllPositive
)
{
padding_bottom
=
yDomainMin
;
}
if
(
isAllNegative
)
{
padding_top
=
-
yDomainMax
;
}
}
return
[
yDomainMin
-
padding_bottom
,
yDomainMax
+
padding_top
];
domain
=
[
yDomainMin
-
padding_bottom
,
yDomainMax
+
padding_top
];
return
isInverted
?
domain
.
reverse
()
:
domain
;
};
c3_chart_internal_fn
.
getXDomainMin
=
function
(
targets
)
{
var
$$
=
this
,
config
=
$$
.
config
;
...
...
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