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
Evgeny
c3-closed
Commits
93c0082e
Commit
93c0082e
authored
May 04, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accept min/max of axis x in axis.min/max - #202
parent
8c580629
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
2 deletions
+87
-2
c3.js
c3.js
+4
-2
c3.min.js
c3.min.js
+0
-0
api_axis_range.html
htdocs/samples/api_axis_range.html
+83
-0
No files found.
c3.js
View file @
93c0082e
...
@@ -4532,23 +4532,25 @@
...
@@ -4532,23 +4532,25 @@
c3
.
axis
.
max
=
function
(
max
)
{
c3
.
axis
.
max
=
function
(
max
)
{
if
(
arguments
.
length
)
{
if
(
arguments
.
length
)
{
if
(
typeof
max
===
'object'
)
{
if
(
typeof
max
===
'object'
)
{
if
(
isValue
(
max
.
x
))
{
__axis_x_max
=
+
max
.
x
;
}
if
(
isValue
(
max
.
y
))
{
__axis_y_max
=
+
max
.
y
;
}
if
(
isValue
(
max
.
y
))
{
__axis_y_max
=
+
max
.
y
;
}
if
(
isValue
(
max
.
y2
))
{
__axis_y2_max
=
+
max
.
y2
;
}
if
(
isValue
(
max
.
y2
))
{
__axis_y2_max
=
+
max
.
y2
;
}
}
else
{
}
else
{
__axis_y_max
=
__axis_y2_max
=
+
max
;
__axis_y_max
=
__axis_y2_max
=
+
max
;
}
}
redraw
();
redraw
(
{
withUpdateOrgXDomain
:
true
,
withUpdateXDomain
:
true
}
);
}
}
};
};
c3
.
axis
.
min
=
function
(
min
)
{
c3
.
axis
.
min
=
function
(
min
)
{
if
(
arguments
.
length
)
{
if
(
arguments
.
length
)
{
if
(
typeof
min
===
'object'
)
{
if
(
typeof
min
===
'object'
)
{
if
(
isValue
(
min
.
x
))
{
__axis_x_min
=
+
min
.
x
;
}
if
(
isValue
(
min
.
y
))
{
__axis_y_min
=
+
min
.
y
;
}
if
(
isValue
(
min
.
y
))
{
__axis_y_min
=
+
min
.
y
;
}
if
(
isValue
(
min
.
y2
))
{
__axis_y2_min
=
+
min
.
y2
;
}
if
(
isValue
(
min
.
y2
))
{
__axis_y2_min
=
+
min
.
y2
;
}
}
else
{
}
else
{
__axis_y_min
=
__axis_y2_min
=
+
min
;
__axis_y_min
=
__axis_y2_min
=
+
min
;
}
}
redraw
();
redraw
(
{
withUpdateOrgXDomain
:
true
,
withUpdateXDomain
:
true
}
);
}
}
};
};
c3
.
axis
.
range
=
function
(
range
)
{
c3
.
axis
.
range
=
function
(
range
)
{
...
...
c3.min.js
View file @
93c0082e
This diff is collapsed.
Click to expand it.
htdocs/samples/api_axis_range.html
0 → 100644
View file @
93c0082e
<html>
<head>
<link
href=
"/css/c3.css"
rel=
"stylesheet"
type=
"text/css"
>
</head>
<body>
<div
id=
"chart"
></div>
<script
src=
"http://d3js.org/d3.v3.min.js"
charset=
"utf-8"
></script>
<script
src=
"/js/c3.js"
></script>
<script>
var
chart
=
c3
.
generate
({
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
50
,
20
,
10
,
40
,
15
,
25
]
],
axes
:
{
data1
:
'y'
,
data2
:
'y2'
,
}
},
axis
:
{
x
:
{
label
:
'X Label'
},
y
:
{
label
:
{
text
:
'Y Axis Label'
,
position
:
'outer-middle'
}
},
y2
:
{
show
:
true
,
label
:
{
text
:
'Y2 Axis Label'
,
position
:
'outer-middle'
}
}
},
tooltip
:
{
// enabled: false
},
zoom
:
{
// enabled: true
},
subchart
:
{
// show: true
}
});
setTimeout
(
function
()
{
chart
.
axis
.
min
({
x
:
-
10
})
chart
.
axis
.
max
({
x
:
10
})
},
1000
);
/*
setTimeout(function () {
chart.axis.max(500);
}, 1000);
setTimeout(function () {
chart.axis.min(-500);
}, 2000);
setTimeout(function () {
chart.axis.max({y: 600, y2: 100});
}, 3000);
setTimeout(function () {
chart.axis.min({y: -600, y2: -100});
}, 4000);
setTimeout(function () {
chart.axis.range({max: 1000, min: -1000});
}, 5000);
setTimeout(function () {
chart.axis.range({max: {y: 600, y2: 100}, min: {y: -100, y2: 0}});
}, 6000);
*/
</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