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
2a11888d
Commit
2a11888d
authored
Jun 05, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug about y domain - #317
parent
628133d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
3 deletions
+68
-3
c3.js
c3.js
+0
-3
c3.min.js
c3.min.js
+0
-0
domain_y.html
htdocs/samples/domain_y.html
+68
-0
No files found.
c3.js
View file @
2a11888d
...
@@ -1234,9 +1234,6 @@
...
@@ -1234,9 +1234,6 @@
isAllPositive
=
yDomainMin
>=
0
&&
yDomainMax
>=
0
;
isAllPositive
=
yDomainMin
>=
0
&&
yDomainMax
>=
0
;
isAllNegative
=
yDomainMin
<=
0
&&
yDomainMax
<=
0
;
isAllNegative
=
yDomainMin
<=
0
&&
yDomainMax
<=
0
;
if
(
isAllPositive
)
{
yDomainMin
=
0
;
}
if
(
isAllNegative
)
{
yDomainMax
=
0
;
}
domainLength
=
Math
.
abs
(
yDomainMax
-
yDomainMin
);
domainLength
=
Math
.
abs
(
yDomainMax
-
yDomainMin
);
padding
=
padding_top
=
padding_bottom
=
domainLength
*
0.1
;
padding
=
padding_top
=
padding_bottom
=
domainLength
*
0.1
;
...
...
c3.min.js
View file @
2a11888d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
htdocs/samples/domain_y.html
0 → 100644
View file @
2a11888d
<html>
<head>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/c3.css"
>
</head>
<body>
<button
id=
"btn1"
>
Bar
</button>
<button
id=
"btn2"
>
Line
</button>
<button
id=
"btn3"
>
Area
</button>
<div
id=
"chart1"
></div>
<div
id=
"chart2"
></div>
<div
id=
"chart3"
></div>
<script
src=
"http://d3js.org/d3.v3.min.js"
charset=
"utf-8"
></script>
<script
src=
"/js/c3.js"
></script>
<script>
var
normalData
=
{
columns
:
[
[
'data1'
,
-
1030
,
-
1200
,
1000
],
[
'data2'
,
-
1150
,
-
220
,
-
1110
]
],
},
allPositiveData
=
{
columns
:
[
[
'data1'
,
1030
,
1200
,
1100
],
[
'data2'
,
2050
,
2020
,
2010
]
],
},
allNegativeData
=
{
columns
:
[
[
'data1'
,
-
1030
,
-
2200
,
-
2100
],
[
'data2'
,
-
1150
,
-
2010
,
-
1200
]
]
}
var
chart1
=
c3
.
generate
({
bindto
:
'#chart1'
,
data
:
normalData
});
var
chart2
=
c3
.
generate
({
bindto
:
'#chart2'
,
data
:
allPositiveData
});
var
chart3
=
c3
.
generate
({
bindto
:
'#chart3'
,
data
:
allNegativeData
});
d3
.
select
(
'#btn1'
).
on
(
'click'
,
function
()
{
chart1
.
transform
(
'bar'
);
chart2
.
transform
(
'bar'
);
chart3
.
transform
(
'bar'
);
});
d3
.
select
(
'#btn2'
).
on
(
'click'
,
function
()
{
chart1
.
transform
(
'line'
);
chart2
.
transform
(
'line'
);
chart3
.
transform
(
'line'
);
});
d3
.
select
(
'#btn3'
).
on
(
'click'
,
function
()
{
chart1
.
transform
(
'area'
);
chart2
.
transform
(
'area'
);
chart3
.
transform
(
'area'
);
});
</script>
</body>
</html>
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