Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
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
Chanachai
BookingMyHrManagement
Commits
108ca11f
Commit
108ca11f
authored
May 16, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
4b46d3b0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
100 deletions
+19
-100
home-common.component.ts
...e/src/app/DPU/common/home-common/home-common.component.ts
+19
-100
No files found.
Web-Manage/src/app/DPU/common/home-common/home-common.component.ts
View file @
108ca11f
...
...
@@ -45,8 +45,8 @@ export class HomeCommonComponent {
allSelected
=
false
;
someSelected
=
false
;
today
=
new
Date
();
startDate
:
string
=
''
endDate
:
string
=
''
startDate
:
string
=
''
endDate
:
string
=
''
itmes
:
string
=
''
;
selectedProjects
:
string
[]
=
[];
selectedEquipmentType
:
string
=
'ALL'
;
...
...
@@ -162,104 +162,7 @@ export class HomeCommonComponent {
this
.
chartOptions9
=
{
series
:
[
{
name
:
'จำนวนการยืม'
,
data
:
[
40
,
55
,
60
,
80
,
70
,
65
,
90
]
},
{
name
:
'จำนวนการคืน'
,
data
:
[
30
,
50
,
58
,
75
,
68
,
63
,
85
]
}
],
chart
:
{
height
:
320
,
type
:
'line'
,
dropShadow
:
{
enabled
:
true
,
color
:
'#000'
,
top
:
18
,
left
:
7
,
blur
:
10
,
opacity
:
0.2
},
toolbar
:
{
show
:
false
},
events
:
{
mounted
:
(
chart
:
any
)
=>
{
chart
.
windowResizeHandler
();
}
},
},
colors
:
[
'#845adf'
,
'#23b7e5'
],
dataLabels
:
{
enabled
:
true
},
stroke
:
{
curve
:
'smooth'
},
title
:
{
text
:
''
,
align
:
'left'
,
style
:
{
fontSize
:
'13px'
,
fontWeight
:
'bold'
,
color
:
'#8c9097'
},
},
grid
:
{
borderColor
:
'#f2f5f7'
,
},
markers
:
{
size
:
3
},
xaxis
:
{
categories
:
[
'ม.ค.'
,
'ก.พ.'
,
'มี.ค.'
,
'เม.ย.'
,
'พ.ค.'
,
'มิ.ย.'
,
'ก.ค.'
],
title
:
{
text
:
'เดือน'
,
style
:
{
color
:
"#8c9097"
,
fontSize
:
'13px'
,
fontWeight
:
'bold'
,
}
},
labels
:
{
style
:
{
colors
:
"#8c9097"
,
fontSize
:
'11px'
,
fontWeight
:
600
}
},
},
yaxis
:
{
title
:
{
text
:
'จำนวนครั้ง'
,
style
:
{
color
:
"#8c9097"
,
fontSize
:
'13px'
,
fontWeight
:
'bold'
,
}
},
labels
:
{
style
:
{
colors
:
"#8c9097"
,
fontSize
:
'11px'
,
fontWeight
:
600
}
},
min
:
0
,
max
:
100
},
legend
:
{
position
:
'top'
,
horizontalAlign
:
'right'
,
floating
:
true
,
offsetY
:
-
25
,
offsetX
:
-
5
}
};
this
.
chartOptions2
=
{
...
...
@@ -915,11 +818,27 @@ export class HomeCommonComponent {
getDashbord
()
{
this
.
DashboardService
.
getDashboard
(
this
.
startDate
,
this
.
endDate
).
subscribe
(
result
=>
{
this
.
dashboardModel
=
result
this
.
updateChart
(
this
.
dashboardModel
)
console
.
log
(
this
.
dashboardModel
)
})
}
private
updateChart
(
data
:
DashboardModel
)
{
// แมป monthly_trends ไปเป็น series + categories
const
trends
=
data
.
monthly_trends
;
this
.
chartOptions9
.
series
=
[
{
name
:
'จำนวนการยืม'
,
data
:
trends
.
map
(
t
=>
t
.
borrowed
)
},
{
name
:
'จำนวนการคืน'
,
data
:
trends
.
map
(
t
=>
t
.
returned
)
},
];
this
.
chartOptions9
.
xaxis
=
{
...
this
.
chartOptions9
.
xaxis
,
categories
:
trends
.
map
(
t
=>
t
.
period
)
};
}
filter
(
v
:
string
)
{
...
...
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