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
758ee70e
Commit
758ee70e
authored
Jun 09, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/matuszewski/c3
into matuszewski-master
parents
a61e7a79
5290f1f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
c3.js
c3.js
+8
-3
No files found.
c3.js
View file @
758ee70e
...
...
@@ -253,7 +253,8 @@
// bar
var
__bar_width
=
getConfig
([
'bar'
,
'width'
]),
__bar_width_ratio
=
getConfig
([
'bar'
,
'width'
,
'ratio'
],
0.6
);
__bar_width_ratio
=
getConfig
([
'bar'
,
'width'
,
'ratio'
],
0.6
),
__bar_zerobased
=
getConfig
([
'bar'
,
'zerobased'
],
true
);
// pie
var
__pie_label_show
=
getConfig
([
'pie'
,
'label'
,
'show'
],
true
),
...
...
@@ -1270,7 +1271,7 @@
isAllNegative
=
yDomainMin
<=
0
&&
yDomainMax
<=
0
;
// Bar/Area chart should be 0-based if all positive|negative
if
(
hasBarType
(
yTargets
)
||
hasAreaType
(
yTargets
))
{
if
(
(
hasBarType
(
yTargets
)
&&
isBarZerobased
()
)
||
hasAreaType
(
yTargets
))
{
if
(
isAllPositive
)
{
yDomainMin
=
0
;
}
if
(
isAllNegative
)
{
yDomainMax
=
0
;
}
}
...
...
@@ -1304,7 +1305,7 @@
padding_bottom
=
getAxisPadding
(
__axis_y2_padding
,
'bottom'
,
padding
,
domainLength
);
}
// Bar/Area chart should be 0-based if all positive|negative
if
(
hasBarType
(
yTargets
)
||
hasAreaType
(
yTargets
))
{
if
(
(
hasBarType
(
yTargets
)
&&
isBarZerobased
()
)
||
hasAreaType
(
yTargets
))
{
if
(
isAllPositive
)
{
padding_bottom
=
yDomainMin
;
}
if
(
isAllNegative
)
{
padding_top
=
-
yDomainMax
;
}
}
...
...
@@ -2236,6 +2237,10 @@
var
id
=
(
typeof
d
===
'string'
)
?
d
:
d
.
id
;
return
__data_types
[
id
]
===
'bar'
;
}
function
isBarZerobased
()
{
return
__bar_zerobased
;
}
function
isScatterType
(
d
)
{
var
id
=
(
typeof
d
===
'string'
)
?
d
:
d
.
id
;
return
__data_types
[
id
]
===
'scatter'
;
...
...
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