Skip to content

Commit

Permalink
Y Axis working
Browse files Browse the repository at this point in the history
  • Loading branch information
tainfante committed Dec 25, 2017
1 parent e46ff77 commit 7a0a6db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
24 changes: 12 additions & 12 deletions src/mainwindow/Chart.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
package mainwindow;

import classes.DateAxis;
<<<<<<< HEAD
=======
import javafx.event.ActionEvent;
>>>>>>> d308831
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.chart.*;
import javafx.scene.control.Alert;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ChoiceBox;
<<<<<<< HEAD
=======
import javafx.scene.control.TextField;
>>>>>>> d308831

import java.net.URL;
import java.util.Date;
Expand Down Expand Up @@ -83,8 +77,6 @@ public void initialize(URL location, ResourceBundle resources) {

}

<<<<<<< HEAD
=======
public void onSubmitChanges(ActionEvent actionEvent) {
String MIN=minText.getText();
String MAX=maxText.getText();
Expand All @@ -94,6 +86,16 @@ public void onSubmitChanges(ActionEvent actionEvent) {
{
min = Double.parseDouble(MIN);
max = Double.parseDouble(MAX);
if(min>max){
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("Wrong data");
alert.setHeaderText("You have submitted wrong data");
alert.setContentText("Minimum value must be lower then the maximum");
alert.showAndWait();
}
yAxis.setAutoRanging(false);
yAxis.setLowerBound(min);
yAxis.setUpperBound(max);
}
catch(NumberFormatException nfe)
{
Expand All @@ -103,9 +105,7 @@ public void onSubmitChanges(ActionEvent actionEvent) {
alert.setContentText("Please, set some numbers");
alert.showAndWait();
}
yAxis.setAutoRanging(false);
yAxis.setLowerBound(min);
yAxis.setUpperBound(max);

}
>>>>>>> d308831

}
13 changes: 0 additions & 13 deletions src/mainwindow/chart.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@

</right>
<bottom>
<<<<<<< HEAD
<HBox spacing="10.0" styleClass="background">
<children>
<Label text="Show data from last:" />
<ChoiceBox prefWidth="150.0" fx:id="timeBox" />
</children>
<BorderPane.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</BorderPane.margin>
</HBox>
=======
<VBox>
<HBox>
<children>
Expand Down Expand Up @@ -119,7 +108,5 @@
</BorderPane.margin>
</HBox>
</VBox>

>>>>>>> d308831
</bottom>
</BorderPane>

0 comments on commit 7a0a6db

Please sign in to comment.