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
a76e3b33
Commit
a76e3b33
authored
May 27, 2014
by
Masayuki Tanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sample for gauge and step - #254
parent
f22e87d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
135 additions
and
0 deletions
+135
-0
chart_gauge.html
htdocs/samples/chart_gauge.html
+48
-0
chart_step.html
htdocs/samples/chart_step.html
+37
-0
chart_step_category.html
htdocs/samples/chart_step_category.html
+50
-0
No files found.
htdocs/samples/chart_gauge.html
0 → 100644
View file @
a76e3b33
<html>
<head>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/css/c3.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
gauge_fuellevel
=
c3
.
generate
({
data
:
{
columns
:
[
[
'%'
,
81.4
]
],
type
:
'gauge'
},
gauge
:
{
// color: '', // default value is a grey. "color: '', " is no background.
label
:
{
format
:
function
(
value
,
ratio
)
{
return
value
;
},
// show: false // to turn off the min/max labels.
},
min
:
0
,
//can handle negative min e.g. vacuum / voltage / current flow / rate of change
max
:
100
,
style
:
'arc'
,
// Only style currently.
units
:
' %'
,
// width: 39 // for adjusting arc thickness
},
legend
:
{
show
:
false
},
size
:
{
height
:
240
,
width
:
240
},
color
:
{
pattern
:
[
'#FF0000'
,
'#F6C600'
,
'#60B044'
],
// the three color levels for the percentage values.
values
:
[
'percentage'
,
30
,
60
,
90
]
// alternate first value is 'value'
}
});
</script>
</body>
</html>
htdocs/samples/chart_step.html
0 → 100644
View file @
a76e3b33
<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'
,
300
,
350
,
300
,
0
,
0
,
0
],
// ['data2', 130, 100, 140, 200, 150, 50]
],
types
:
{
data1
:
'step'
,
data2
:
'area-step'
}
},
subchart
:
{
show
:
true
},
});
setTimeout
(
function
()
{
chart
.
load
({
columns
:
[
[
'data2'
,
130
,
100
,
140
,
200
,
150
,
50
]
]
});
},
1000
);
</script>
</body>
</html>
htdocs/samples/chart_step_category.html
0 → 100644
View file @
a76e3b33
<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
:
{
x
:
'x'
,
columns
:
[
[
'x'
,
'hogehoge'
,
'aaa'
,
'aaaaaa'
,
'a'
,
'b'
],
[
'data1'
,
300
,
350
,
300
,
0
,
0
,
0
],
// ['data2', 130, 100, 140, 200, 150, 50]
],
types
:
{
data1
:
'step'
,
data2
:
'area-step'
},
empty
:
{
abort
:
false
,
label
:
{
text
:
'hoge'
}
}
},
axis
:
{
x
:
{
type
:
'categorized'
}
},
subchart
:
{
show
:
true
},
});
setTimeout
(
function
()
{
chart
.
load
({
columns
:
[
[
'data2'
,
130
,
100
,
140
,
200
,
150
,
50
]
]
});
},
1000
);
</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