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
fc658310
Commit
fc658310
authored
May 27, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jasonxunxu-master'
parents
facf083d
98502fe6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
15 deletions
+29
-15
c3.js
c3.js
+2
-11
c3.min.js
c3.min.js
+0
-0
categorized.html
htdocs/samples/categorized.html
+27
-4
No files found.
c3.js
View file @
fc658310
...
...
@@ -759,7 +759,6 @@
if
(
isEmpty
(
__axis_x_tick_culling
))
{
__axis_x_tick_culling
=
false
;
}
axis
.
categories
(
__axis_x_categories
);
}
else
{
// TODO: move this to c3_axis
axis
.
tickOffset
=
function
()
{
...
...
@@ -4637,7 +4636,6 @@
// update categories if exists
if
(
'categories'
in
args
&&
isCategorized
)
{
__axis_x_categories
=
args
.
categories
;
xAxis
.
categories
(
__axis_x_categories
);
}
// use cache if exists
if
(
'cacheIds'
in
args
&&
hasCaches
(
args
.
cacheIds
))
{
...
...
@@ -5063,8 +5061,7 @@
function
c3_axis
(
d3
,
isCategory
)
{
var
scale
=
d3
.
scale
.
linear
(),
orient
=
"bottom"
,
innerTickSize
=
6
,
outerTickSize
=
6
,
tickPadding
=
3
,
tickValues
=
null
,
tickFormat
,
tickArguments
;
var
tickOffset
=
0
,
tickCulling
=
true
;
var
categories
=
[],
tickCentered
;
var
tickOffset
=
0
,
tickCulling
=
true
,
tickCentered
;
function
axisX
(
selection
,
x
)
{
selection
.
attr
(
"transform"
,
function
(
d
)
{
...
...
@@ -5102,8 +5099,7 @@
}
return
newScale
;
}
function
textFormatted
(
i
)
{
var
v
=
isCategory
&&
i
<
categories
.
length
?
categories
[
i
]
:
i
;
function
textFormatted
(
v
)
{
return
tickFormat
?
tickFormat
(
v
)
:
v
;
}
function
axis
(
g
)
{
...
...
@@ -5240,11 +5236,6 @@
tickValues
=
x
;
return
axis
;
};
axis
.
categories
=
function
(
x
)
{
if
(
!
arguments
.
length
)
{
return
categories
;
}
categories
=
x
;
return
axis
;
};
return
axis
;
}
...
...
c3.min.js
View file @
fc658310
This source diff could not be displayed because it is too large. You can
view the blob
instead.
htdocs/samples/categorized.html
View file @
fc658310
...
...
@@ -3,14 +3,18 @@
<link
href=
"/css/c3.css"
rel=
"stylesheet"
type=
"text/css"
>
</head>
<body>
<div
id=
"chart"
></div>
<div
id=
"chart1"
></div>
<div
id=
"chart2"
></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
({
var
chart1
=
c3
.
generate
({
bindto
:
'#chart1'
,
data
:
{
x
:
'x'
,
columns
:
[
[
'x'
,
'1e-3'
,
'1e-2'
,
'1'
],
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
,
50
,
100
,
250
]
]
},
...
...
@@ -21,9 +25,28 @@
}
});
var
chart2
=
c3
.
generate
({
bindto
:
'#chart2'
,
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
,
50
,
100
,
250
]
]
},
axis
:
{
x
:
{
categories
:
[
'1e-3'
,
'1e-2'
,
'1e-1'
,
'0'
,
'hoge'
],
type
:
'categorized'
}
}
});
setTimeout
(
function
()
{
chart1
.
load
({
columns
:[[
'data2'
,
30
,
20
,
50
,
40
,
60
,
50
,
100
,
200
,
300
,
100
]]});
},
1000
);
setTimeout
(
function
()
{
chart
.
load
({
columns
:[[
'data2'
,
30
,
20
,
50
,
40
,
60
,
50
,
100
,
200
,
300
,
100
]]});
},
5
00
);
chart
2
.
load
({
columns
:[[
'data2'
,
30
,
20
,
50
,
40
,
60
,
50
,
100
,
200
,
300
,
100
]]});
},
20
00
);
</script>
</body>
...
...
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