本文整理匯總了Java中javafx.scene.chart.NumberAxis.setForceZeroInRange方法的典型用法代碼示例。如果您正苦於以下問題:Java NumberAxis.setForceZeroInRange方法的具體用法?Java NumberAxis.setForceZeroInRange怎麽用?Java NumberAxis.setForceZeroInRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.chart.NumberAxis
的用法示例。
在下文中一共展示了NumberAxis.setForceZeroInRange方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createChart
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected ScatterChart<Number, Number> createChart() {
final NumberAxis xAxis = new NumberAxis();
xAxis.setForceZeroInRange(false);
final NumberAxis yAxis = new NumberAxis(-100,100,10);
final ScatterChart<Number,Number> sc = new ScatterChart<Number,Number>(xAxis,yAxis);
// setup chart
sc.setId("liveScatterChart");
sc.setTitle("Animated Sine Wave ScatterChart");
xAxis.setLabel("X Axis");
xAxis.setAnimated(false);
yAxis.setLabel("Y Axis");
yAxis.setAutoRanging(false);
// add starting data
series = new ScatterChart.Series<Number,Number>();
series.setName("Sine Wave");
series.getData().add(new ScatterChart.Data<Number, Number>(5d, 5d));
sc.getData().add(series);
return sc;
}
示例2: initialize
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
@Override
public void initialize(URL location, ResourceBundle resources) {
sdf = new SimpleDateFormat(Constants.TIMEFORMAT);
isNameEdit = false;
NumberAxis numberAxis = new NumberAxis();
numberAxis.setForceZeroInRange(false);
DateAxis dateAxis = new DateAxis();
tempChart = new LineChart<>(dateAxis, numberAxis);
tempChart.setLegendVisible(false);
tempChart.setCreateSymbols(false);
contentPane.setCenter(tempChart);
intervalCB.setItems(GraphInterval.INTERVALS);
intervalCB.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> {
if (sensor != null) {
sensor.setGraphInterval(newValue);
}
});
intervalCB.getSelectionModel().select(1);
offsetCB.setItems(OFFSET_VALUES);
offsetCB.getSelectionModel().select(6);
}
示例3: createChart
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private void createChart() {
xAxis = new NumberAxis();
xAxis.setForceZeroInRange(false);
xAxis.setAutoRanging(true);
NumberAxis yAxis = new NumberAxis();
yAxis.setForceZeroInRange(false);
yAxis.setAutoRanging(true);
yAxis.setLabel(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode()));
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis, "", ""));
seriesBuy = new XYChart.Series<>();
seriesSell = new XYChart.Series<>();
areaChart = new AreaChart<>(xAxis, yAxis);
areaChart.setLegendVisible(false);
areaChart.setAnimated(false);
areaChart.setId("charts");
areaChart.setMinHeight(300);
areaChart.setPrefHeight(300);
areaChart.setPadding(new Insets(0, 30, 0, 0));
areaChart.getData().addAll(seriesBuy, seriesSell);
}
示例4: start
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
@Override
public void start(Stage stage) {
stage.setTitle("Beacon RSSI");
//defining the axes
final NumberAxis xAxis = new NumberAxis();
final NumberAxis yAxis = new NumberAxis();
xAxis.setLabel("Minute");
xAxis.setAutoRanging(true);
xAxis.setForceZeroInRange(false);
//creating the chart
final LineChart<Number, Number> lineChart = new LineChart<>(xAxis, yAxis);
lineChart.setTitle("Beacon RSSI");
//defining a series
XYChart.Series series = new XYChart.Series();
series.setName("RSSI");
//populating the series with data
series.getData().addAll(data);
Scene scene = new Scene(lineChart, 800, 600);
lineChart.getData().add(series);
stage.setScene(scene);
stage.show();
}
示例5: initYAxis
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private NumberAxis initYAxis() {
final NumberAxis yAxis = new NumberAxis(800, 802, 0.1);
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
@Override
public String toString(final Number object) {
return String.format("%6.2f", object);
}
});
yAxis.setTickLabelFont(Font.font("Arial", FontWeight.MEDIUM, 18));
yAxis.setPrefWidth(120);
yAxis.setAutoRanging(false);
yAxis.setLabel("Meters");
yAxis.setForceZeroInRange(false);
yAxis.setAnimated(true);
return yAxis;
}
示例6: initYAxis
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private NumberAxis initYAxis() {
final NumberAxis yAxis = new NumberAxis();
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
@Override
public String toString(final Number object) {
return String.format("%6.2f", object);
}
});
yAxis.setTickLabelFont(Font.font("Arial", FontWeight.MEDIUM, 18));
yAxis.setPrefWidth(120);
yAxis.setAutoRanging(true);
yAxis.setLabel("m/s");
yAxis.setForceZeroInRange(false);
yAxis.setAnimated(false);
return yAxis;
}
示例7: initYAxis
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private NumberAxis initYAxis() {
final NumberAxis yAxis = new NumberAxis();
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
@Override
public String toString(final Number object) {
return String.format("%6.2f", object);
}
});
yAxis.setTickLabelFont(Font.font("Arial", FontWeight.MEDIUM, 18));
yAxis.setPrefWidth(120);
yAxis.setAutoRanging(true);
yAxis.setLabel("Meters");
yAxis.setForceZeroInRange(false);
yAxis.setAnimated(true);
return yAxis;
}
示例8: initYAxis
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private NumberAxis initYAxis() {
final NumberAxis yAxis = new NumberAxis();
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
@Override
public String toString(final Number object) {
return String.format("%6.2f", object);
}
});
yAxis.setTickLabelFont(Font.font("Arial", FontWeight.MEDIUM, 18));
yAxis.setPrefWidth(120);
yAxis.setAutoRanging(true);
yAxis.setLabel("m/s^2");
yAxis.setForceZeroInRange(false);
yAxis.setAnimated(false);
return yAxis;
}
示例9: initYAxis
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private NumberAxis initYAxis() {
final NumberAxis yAxis = new NumberAxis();
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis) {
@Override
public String toString(final Number object) {
return String.format("%6.2f", object);
}
});
yAxis.setTickLabelFont(Font.font("Arial", FontWeight.MEDIUM, 18));
yAxis.setPrefWidth(120);
yAxis.setAutoRanging(true);
yAxis.setLabel("factor");
yAxis.setForceZeroInRange(false);
yAxis.setAnimated(false);
return yAxis;
}
示例10: createChart
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected LineChart<Number, Number> createChart() {
xAxis = new NumberAxis(0,24,3);
final NumberAxis yAxis = new NumberAxis(0,100,10);
final LineChart<Number,Number> lc = new LineChart<Number,Number>(xAxis,yAxis);
// setup chart
lc.setId("lineStockDemo");
lc.setCreateSymbols(false);
lc.setAnimated(false);
lc.setLegendVisible(false);
lc.setTitle("ACME Company Stock");
xAxis.setLabel("Time");
xAxis.setForceZeroInRange(false);
yAxis.setLabel("Share Price");
yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis,"$",null));
// add starting data
hourDataSeries = new XYChart.Series<Number,Number>();
hourDataSeries.setName("Hourly Data");
minuteDataSeries = new XYChart.Series<Number,Number>();
minuteDataSeries.setName("Minute Data");
// create some starting data
hourDataSeries.getData().add(new XYChart.Data<Number,Number>(timeInHours,prevY));
minuteDataSeries.getData().add(new XYChart.Data<Number,Number>(timeInHours,prevY));
for (double m=0; m<(60); m++) {
nextTime();
plotTime();
}
lc.getData().add(minuteDataSeries);
lc.getData().add(hourDataSeries);
return lc;
}
示例11: AreaChartControl
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
public AreaChartControl(String name) {
super(name, FlashboardSendableType.AREACHART);
axisX = new NumberAxis();
axisX.setForceZeroInRange(false);
axisX.setAutoRanging(false);
axisX.setUpperBound(maxX);
axisX.setLowerBound(minX);
axisY = new NumberAxis();
axisY.setForceZeroInRange(false);
axisY.setAutoRanging(false);
axisY.setUpperBound(maxY);
axisY.setLowerBound(minY);
chart = new AreaChart<Number, Number>(axisX, axisY);
chart.setLegendVisible(false);
chart.setAnimated(false);
chartSeries = new AreaChart.Series<Number, Number>();
chart.setTitle(name);
chart.getData().add(chartSeries);
root = new VBox();
root.setAlignment(Pos.CENTER);
root.setMaxSize(WIDTH, HEIGHT);
root.getChildren().add(chart);
}
示例12: BarChartControl
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
public BarChartControl(String name) {
super(name, FlashboardSendableType.BARCHART);
axisX = new CategoryAxis();
axisX.setAutoRanging(true);
axisY = new NumberAxis();
axisY.setForceZeroInRange(false);
axisY.setAutoRanging(false);
axisY.setUpperBound(maxY);
axisY.setLowerBound(minY);
chart = new BarChart<String, Number>(axisX, axisY);
chart.setLegendVisible(false);
chart.setAnimated(false);
chartSeries = new BarChart.Series<String, Number>();
chart.setTitle(name);
chart.getData().add(chartSeries);
root = new VBox();
root.setAlignment(Pos.CENTER);
root.setMaxSize(WIDTH, HEIGHT);
root.getChildren().add(chart);
charts.put(name, this);
List<BarChartSeriesControl> controls = unallocatedControls.get(name);
if(unallocatedControls != null){
unallocatedControls.remove(name);
for (int i = 0; i < unallocatedControls.size(); i++)
addControl(controls.get(i));
}
}
示例13: LineChartControl
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
public LineChartControl(String name) {
super(name, FlashboardSendableType.LINECHART);
axisX = new NumberAxis();
axisX.setForceZeroInRange(false);
axisX.setAutoRanging(false);
axisX.setUpperBound(maxX);
axisX.setLowerBound(minX);
axisY = new NumberAxis();
axisY.setForceZeroInRange(false);
axisY.setAutoRanging(false);
axisY.setUpperBound(maxY);
axisY.setLowerBound(minY);
chart = new LineChart<Number, Number>(axisX, axisY);
chart.setLegendVisible(false);
chart.setAnimated(false);
chartSeries = new LineChart.Series<Number, Number>();
chart.setTitle(name);
chart.getData().add(chartSeries);
root = new VBox();
root.setAlignment(Pos.CENTER);
root.setMaxSize(WIDTH, HEIGHT);
root.getChildren().add(chart);
}
示例14: start
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
@Override
public void start(final Stage stage) {
stage.setTitle("Line Chart Sample");
// defining the axes
final NumberAxis xAxis = new NumberAxis();
final NumberAxis yAxis = new NumberAxis();
xAxis.setAutoRanging(true);
xAxis.setForceZeroInRange(false);
yAxis.setAutoRanging(true);
yAxis.setForceZeroInRange(false);
xAxis.setLabel("Number of Month");
// creating the chart
final LineChart<Number, Number> lineChart = new LineChart<Number, Number>(xAxis, yAxis);
lineChart.setTitle("Stock Monitoring, 2010");
// defining a series
final XYChart.Series series = new XYChart.Series();
series.setName("My portfolio");
// populating the series with data
series.getData().add(new XYChart.Data(1, 23));
series.getData().add(new XYChart.Data(2, 14));
series.getData().add(new XYChart.Data(3, 15));
series.getData().add(new XYChart.Data(4, 24));
series.getData().add(new XYChart.Data(5, 34));
series.getData().add(new XYChart.Data(6, 36));
series.getData().add(new XYChart.Data(7, 22));
series.getData().add(new XYChart.Data(8, 45));
series.getData().add(new XYChart.Data(9, 43));
series.getData().add(new XYChart.Data(10, 17));
series.getData().add(new XYChart.Data(11, 29));
series.getData().add(new XYChart.Data(12, 25));
// DO NOT ADD DATA TO CHART
// bc.getData().addAll(series1, series2, series3);
final StackPane pane = new StackPane();
pane.getChildren().add(lineChart);
final Scene scene = new Scene(pane, 500, 400);
new ZoomManager(pane, lineChart, series);
stage.setScene(scene);
stage.show();
}
示例15: createChart
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
public LineChart<String, Number> createChart(LabelledRadiusPane pane) {
CategoryAxis xAxis = new CategoryAxis();
NumberAxis yAxis = new NumberAxis();
chart = new LineChart<>(xAxis, yAxis);
chart.setTitle("Tweet Trend Analysis");
chart.setCreateSymbols(false);
chart.setLegendVisible(false);
xAxis.setLabel("Time of Tweet");
yAxis.setUpperBound(1.0);
yAxis.setLowerBound(0.0);
yAxis.setLabel("Anomaly\n Score");
yAxis.setForceZeroInRange(true);
series = new XYChart.Series<>();
series.setName("Tweet Data");
chart.getData().add(series);
chartSeriesProperty.set(series);
Node line = series.getNode().lookup(".chart-series-line");
line.setStyle("-fx-stroke: rgb(20, 164, 220)");
chart.setPrefWidth(1200);
chart.setPrefHeight(275);
chart.setLayoutY(pane.labelHeightProperty().get() + 10);
return chart;
}