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