Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Projet_idaw
Project
Project
Details
Activity
Releases
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Liang Wu
Projet_idaw
Commits
065f833f
Commit
065f833f
authored
Apr 05, 2020
by
Liang Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard
parent
cc496447
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
23 deletions
+38
-23
accueil.php
accueil.php
+38
-23
No files found.
accueil.php
View file @
065f833f
<section>
<canvas
id=
"myChart"
></canvas>
<script
src=
"https://cdn.jsdelivr.net/npm/chart.js@2.8.0"
></script>
<script>
Chart
.
defaults
.
global
.
title
.
display
=
true
;
Chart
.
defaults
.
global
.
title
.
text
=
"Consommation de calories"
;
</script>
<script>
var
ctx
=
document
.
getElementById
(
'myChart'
).
getContext
(
'2d'
);
var
chart
=
new
Chart
(
ctx
,
{
// The type of chart we want to create
type
:
'line'
,
<div
class=
"chart"
>
<div
class=
"row"
style=
"margin:20px;width:150%;height:150%"
>
<div
id=
"cardChartCalories"
class=
"card cardChart"
>
<div
class=
"card-header"
style=
"color:black"
>
Qunantité de calories consommée par jour
</div>
<div
class=
"card-body"
>
<canvas
id=
"chartCalories"
></canvas>
</div>
</div>
</div>
<div
class=
"row"
>
<div
id=
"cardChartRepartition"
class=
"card cardChart"
>
<div
class=
"card-header"
style=
"color:black"
>
Répartition
</div>
<div
class=
"card-body"
>
<canvas
id=
"chartRegime"
></canvas>
</div>
</div>
</div>
</div>
// The data for our dataset
data
:
{
labels
:
[
'January'
,
'February'
,
'March'
,
'April'
,
'May'
,
'June'
,
'July'
],
datasets
:
[{
label
:
'My First dataset'
,
backgroundColor
:
'rgb(255, 99, 132)'
,
borderColor
:
'rgb(255, 99, 132)'
,
data
:
[
0
,
10
,
5
,
2
,
20
,
30
,
45
]
}]
},
// Configuration options go here
options
:
{}
<script>
new
Chart
(
document
.
getElementById
(
"chartCalories"
),{
"type"
:
"bar"
,
"data"
:{
"labels"
:[
"January"
,
"February"
,
"March"
,
"April"
,
"May"
,
"June"
,
"July"
],
"datasets"
:[{
"label"
:
"calories en Kcal"
,
"data"
:[
65
,
59
,
80
,
81
,
56
,
55
,
40
],
"borderColor"
:
"rgb(255, 205, 86)"
}]},
"options"
:{}
});
new
Chart
(
document
.
getElementById
(
"chartRegime"
),{
"type"
:
"pie"
,
"data"
:{
"labels"
:[
"Viande"
,
"Légumes/Fruits"
,
"Féculents"
],
"datasets"
:[{
"label"
:
"Quantité de consommation"
,
"data"
:[
300
,
50
,
100
],
"backgroundColor"
:[
"rgb(255, 99, 132)"
,
"rgb(54, 162, 235)"
,
"rgb(255, 205, 86)"
]}]}});
</script>
</section>
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