Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
QE Research Group
FORTE
Frontend
Commits
cd33ce06
Commit
cd33ce06
authored
1 year ago
by
Bilal Hassan
Browse files
Options
Downloads
Patches
Plain Diff
-fixing show empty data also in the beginning of the graph issue
#47
parent
5ebdd980
No related branches found
No related tags found
3 merge requests
!25
Draft: Resolve #78
,
!7
fixUrlPath
,
!6
Improve performance of chart.js
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/module/components/charts/Cjs-timeline-multiple/cjsTimlineMultiple.component.ts
+15
-2
15 additions, 2 deletions
...rts/Cjs-timeline-multiple/cjsTimlineMultiple.component.ts
with
15 additions
and
2 deletions
src/app/module/components/charts/Cjs-timeline-multiple/cjsTimlineMultiple.component.ts
+
15
−
2
View file @
cd33ce06
...
...
@@ -6,6 +6,7 @@ import { LogLevel, MyLoggerServiceService } from '../../../../shared/service/my-
import
{
SensorData
}
from
'
../../pro-view/pro-view.component
'
import
{
ReadingPayload
}
from
'
../../../../../../projects/generated-api/src
'
@
Component
({
selector
:
'
app-Cjs-timeline-multiple
'
,
templateUrl
:
'
./cjsTimlineMultiple.component.html
'
,
...
...
@@ -90,7 +91,7 @@ export class CjsTimelineMultiple implements OnInit, OnChanges {
},
]
let
datePipe
=
new
DatePipe
(
'
en-US
'
)
let
startDate
:
Date
let
endDate
:
Date
let
newData
=
[]
...
...
@@ -286,11 +287,23 @@ export class CjsTimelineMultiple implements OnInit, OnChanges {
if
(
this
.
sensorDataArray
.
at
(
0
)
!=
undefined
)
timestamp
=
this
.
sensorDataArray
.
at
(
1
)?.
map
(
x
=>
x
.
timestamp
)
??
[];
let
lastDateUser
=
new
Date
(
this
.
to
?.
toString
()
??
""
)
let
firstUserDate
=
new
Date
(
this
.
from
?.
toString
()
??
""
)
let
firstDateData
=
new
Date
(
timestamp
.
at
(
0
)
??
""
)
let
lastDateData
=
new
Date
(
timestamp
.
at
(
timestamp
.
length
-
1
)
??
""
)
let
bevorelastDateData
=
new
Date
(
timestamp
.
at
(
timestamp
.
length
-
2
)
??
""
)
//add missing data if it is missing at the start
//calculation time difference
//calculate Missing data
let
timeDiff
=
timeDifference
(
bevorelastDateData
,
lastDateData
)
let
firstDateDateBevore
=
new
Date
(
firstDateData
.
getTime
()
-
timeDiff
);
let
missingDateStart
:
string
[]
=
getMissingData
(
firstUserDate
,
firstDateDateBevore
,
timeDiff
)
this
.
timeStampsAsHour
=
[...
missingDateStart
,...
this
.
timeStampsAsHour
]
let
yMissing
=
Array
(
missingDateStart
.
length
).
fill
(
null
)
//have to fill missing y values with null
//add missing data if it is missing at the end
//calculation time difference
//calculate Missing data
let
misssingData
:
string
[]
=
getMissingData
(
lastDateData
,
lastDateUser
,
timeDiff
)
//add Missing data to the array
...
...
@@ -305,7 +318,7 @@ export class CjsTimelineMultiple implements OnInit, OnChanges {
this
.
dataParentArrayError
=
[[]]
this
.
sensorDataArray
.
forEach
((
sensDat
)
=>
{
this
.
dataParentArray
.
push
(
sensDat
.
map
((
x
)
=>
x
.
readings
.
map
((
y
)
=>
y
.
value
)).
flat
(),
[...
yMissing
,...
sensDat
.
map
((
x
)
=>
x
.
readings
.
map
((
y
)
=>
y
.
value
)).
flat
()
]
,
)
this
.
dataParentArrayError
.
push
(
sensDat
.
map
((
x
)
=>
x
.
errorStatus
))
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment