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
b398c0b6
Commit
b398c0b6
authored
Jun 21, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update sampel for data.json
parent
ba997024
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
29 deletions
+43
-29
data_json.html
htdocs/samples/data_json.html
+43
-29
No files found.
htdocs/samples/data_json.html
View file @
b398c0b6
...
...
@@ -3,16 +3,13 @@
<link
href=
"/css/c3.css"
rel=
"stylesheet"
type=
"text/css"
>
</head>
<body>
<div
id=
"chart1"
></div>
<div
id=
"chart2"
></div>
<div
id=
"chart3"
></div>
<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
chart1
=
c3
.
generate
({
bindto
:
'#chart1'
,
var
chart
=
c3
.
generate
({
data
:
{
json
:
{
data1
:
[
30
,
20
,
50
,
40
,
60
,
50
],
...
...
@@ -22,30 +19,8 @@
}
});
var
chart2
=
c3
.
generate
({
bindto
:
'#chart2'
,
data
:
{
// x: 'name',
json
:
[
{
id
:
1
,
name
:
'abc'
,
visits
:
200
},
{
id
:
2
,
name
:
'efg'
,
visits
:
400
},
{
id
:
3
,
name
:
'pqr'
,
visits
:
150
},
{
id
:
4
,
name
:
'xyz'
,
visits
:
420
},
],
keys
:
{
x
:
'name'
,
value
:
[
'visits'
],
}
},
axis
:
{
x
:
{
type
:
'categorized'
}
}
});
var
chart3
=
c3
.
generate
({
bindto
:
'#chart3'
,
setTimeout
(
function
()
{
chart
=
c3
.
generate
({
data
:
{
json
:
[{
"date"
:
"2014-06-03"
,
...
...
@@ -70,6 +45,45 @@
}
}
});
},
1000
);
setTimeout
(
function
()
{
chart
=
c3
.
generate
({
data
:
{
// x: 'name',
json
:
[
{
id
:
1
,
name
:
'abc'
,
visits
:
200
},
{
id
:
2
,
name
:
'efg'
,
visits
:
400
},
{
id
:
3
,
name
:
'pqr'
,
visits
:
150
},
{
id
:
4
,
name
:
'xyz'
,
visits
:
420
},
],
keys
:
{
x
:
'name'
,
value
:
[
'visits'
],
}
},
axis
:
{
x
:
{
type
:
'categorized'
}
}
});
},
2000
);
setTimeout
(
function
()
{
chart
.
load
({
json
:
[
{
id
:
1
,
name
:
'abc'
,
visits
:
1200
},
{
id
:
2
,
name
:
'efg'
,
visits
:
900
},
{
id
:
3
,
name
:
'pqr'
,
visits
:
1150
},
{
id
:
4
,
name
:
'xyz'
,
visits
:
1020
},
],
keys
:
{
x
:
'name'
,
value
:
[
'visits'
],
}
});
},
3000
);
</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