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
5bc0f8c5
Commit
5bc0f8c5
authored
Jun 12, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add category/categories API - #327
parent
a2aea133
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
c3.js
c3.js
+14
-0
c3.min.js
c3.min.js
+0
-0
api_category.html
htdocs/samples/api_category.html
+48
-0
No files found.
c3.js
View file @
5bc0f8c5
...
...
@@ -5227,6 +5227,20 @@
return
__data_colors
;
};
c3
.
category
=
function
(
i
,
category
)
{
if
(
arguments
.
length
>
1
)
{
__axis_x_categories
[
i
]
=
category
;
redraw
();
}
return
__axis_x_categories
[
i
];
};
c3
.
categories
=
function
(
categories
)
{
if
(
!
arguments
.
length
)
{
return
__axis_x_categories
;
}
__axis_x_categories
=
categories
;
redraw
();
return
__axis_x_categories
;
};
c3
.
color
=
color
;
c3
.
x
=
function
(
x
)
{
...
...
c3.min.js
View file @
5bc0f8c5
This source diff could not be displayed because it is too large. You can
view the blob
instead.
htdocs/samples/api_category.html
0 → 100644
View file @
5bc0f8c5
<html>
<head>
<link
href=
"/css/c3.css"
rel=
"stylesheet"
type=
"text/css"
>
</head>
<body>
<div
id=
"chart"
></div>
<div
id=
"message"
></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
:
{
x
:
'x'
,
columns
:
[
[
'x'
,
'1e-3'
,
'1e-2'
,
'1'
],
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
,
50
,
100
,
250
]
]
},
axis
:
{
x
:
{
type
:
'categorized'
}
}
});
setTimeout
(
function
()
{
d3
.
select
(
'#message'
).
node
().
innerHTML
=
"chart.categories() =>"
+
chart
.
categories
();
},
1000
);
setTimeout
(
function
()
{
chart
.
categories
([
'updated 1'
,
'updated 2'
,
'updated 3'
,
'updated 4'
]);
d3
.
select
(
'#message'
).
node
().
innerHTML
=
""
;
},
2000
);
setTimeout
(
function
()
{
d3
.
select
(
'#message'
).
node
().
innerHTML
=
"chart.category(1) =>"
+
chart
.
category
(
1
);
},
3000
);
setTimeout
(
function
()
{
chart
.
category
(
1
,
'UPDATED 1'
);
d3
.
select
(
'#message'
).
node
().
innerHTML
=
""
;
},
4000
);
</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