Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Bacheloroppgave_2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository 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
Eilert Tunheim
Bacheloroppgave_2022
Commits
428ed331
Commit
428ed331
authored
3 years ago
by
Eilert Tunheim
Browse files
Options
Downloads
Patches
Plain Diff
Good enough x-axis, not smooth, but best i could do...
parent
897b8e5b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/application/GUI/LineChartFunctionality.java
+5
-5
5 additions, 5 deletions
...main/java/com/application/GUI/LineChartFunctionality.java
target/classes/com/application/GUI/LineChartFunctionality.class
+0
-0
0 additions, 0 deletions
.../classes/com/application/GUI/LineChartFunctionality.class
with
5 additions
and
5 deletions
src/main/java/com/application/GUI/LineChartFunctionality.java
+
5
−
5
View file @
428ed331
...
...
@@ -4,7 +4,6 @@ import javafx.scene.chart.CategoryAxis;
import
javafx.scene.chart.LineChart
;
import
javafx.scene.chart.NumberAxis
;
import
javafx.scene.chart.XYChart
;
import
javafx.scene.shape.Line
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -21,11 +20,12 @@ public class LineChartFunctionality {
xAxis
=
new
CategoryAxis
();
yAxis
=
new
NumberAxis
();
lineChart
=
new
LineChart
<>(
xAxis
,
yAxis
);
xAxis
.
setLabel
(
"
Date
"
);
xAxis
.
setLabel
(
"
Hours
"
);
xAxis
.
setAnimated
(
false
);
yAxis
.
setLabel
(
"Kwh"
);
yAxis
.
setAnimated
(
false
);
lineChart
.
setTitle
(
"Drying Processes"
);
lineChart
.
setCreateSymbols
(
false
);
}
public
static
void
setLineChart
(
LineChart
<
String
,
Number
>
lineChart
)
{
...
...
@@ -44,7 +44,7 @@ public class LineChartFunctionality {
lineChart
.
getData
().
clear
();
}
private
static
long
findDifference
(
String
start_date
,
String
end_date
)
{
private
static
double
findDifference
(
String
start_date
,
String
end_date
)
{
// Defining a simple date format
SimpleDateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
...
@@ -54,7 +54,7 @@ public class LineChartFunctionality {
Date
dateEnd
=
dateFormat
.
parse
(
end_date
);
// Finds the difference in millis
long
differenceMillis
=
dateEnd
.
getTime
()
-
dateStart
.
getTime
();
double
differenceMillis
=
dateEnd
.
getTime
()
-
dateStart
.
getTime
();
// Finds the difference in minutes
return
(
differenceMillis
/
(
1000
*
60
))
%
60
;
...
...
@@ -95,7 +95,7 @@ public class LineChartFunctionality {
minutes
+=
findDifference
(
previouseDate
,
currentDate
);
hours
=
(
minutes
/
60
)
;
hours
=
minutes
/
60
;
System
.
out
.
println
(
hours
);
previouseDate
=
currentDate
;
...
...
This diff is collapsed.
Click to expand it.
target/classes/com/application/GUI/LineChartFunctionality.class
+
0
−
0
View file @
428ed331
No preview for this file type
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