當前位置: 首頁>>代碼示例>>Java>>正文


Java NumberAxis.setLabel方法代碼示例

本文整理匯總了Java中javafx.scene.chart.NumberAxis.setLabel方法的典型用法代碼示例。如果您正苦於以下問題:Java NumberAxis.setLabel方法的具體用法?Java NumberAxis.setLabel怎麽用?Java NumberAxis.setLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.chart.NumberAxis的用法示例。


在下文中一共展示了NumberAxis.setLabel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createChart

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected LineChart<String, Number> createChart() {
    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis();
    final LineChart<String,Number> lc = new LineChart<String,Number>(xAxis,yAxis);
    // setup chart
    lc.setTitle("LineChart with Category Axis");
    xAxis.setLabel("X Axis");
    yAxis.setLabel("Y Axis");
    // add starting data
    XYChart.Series<String,Number> series = new XYChart.Series<String,Number>();
    series.setName("Data Series 1");
    series.getData().add(new XYChart.Data<String,Number>(CATEGORIES[0], 50d));
    series.getData().add(new XYChart.Data<String,Number>(CATEGORIES[1], 80d));
    series.getData().add(new XYChart.Data<String,Number>(CATEGORIES[2], 90d));
    series.getData().add(new XYChart.Data<String,Number>(CATEGORIES[3], 30d));
    series.getData().add(new XYChart.Data<String,Number>(CATEGORIES[4], 122d));
    series.getData().add(new XYChart.Data<String,Number>(CATEGORIES[5], 10d));
    lc.getData().add(series);
    return lc;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:21,代碼來源:AdvLineCategoryChartSample.java

示例2: 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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:ChartAdvancedScatterLive.java

示例3: createChart

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected AreaChart<Number,Number> createChart() {
    final NumberAxis xAxis = new NumberAxis(0,128,8);
    final NumberAxis yAxis = new NumberAxis(0,50,10);
    final AreaChart<Number,Number> ac = new AreaChart<Number,Number>(xAxis,yAxis);
    // setup chart
    ac.setId("audioAreaDemo");
    ac.setLegendVisible(false);
    ac.setTitle("Live Audio Spectrum Data");
    ac.setAnimated(false);
    xAxis.setLabel("Frequency Bands");
    yAxis.setLabel("Magnitudes");
    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis,null,"dB"));
    // add starting data
    XYChart.Series<Number,Number> series = new XYChart.Series<Number,Number>();
    series.setName("Audio Spectrum");
    //noinspection unchecked
    series1Data = new XYChart.Data[(int)xAxis.getUpperBound()];
    for (int i=0; i<series1Data.length; i++) {
        series1Data[i] = new XYChart.Data<Number,Number>(i,50);
        series.getData().add(series1Data[i]);
    }
    ac.getData().add(series);
    return ac;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:25,代碼來源:AdvAreaAudioChartSample.java

示例4: createChart

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected ScatterChart<Number, Number> createChart() {
    final NumberAxis xAxis = new NumberAxis();
    xAxis.setSide(Side.TOP);
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setSide(Side.RIGHT);
    final ScatterChart<Number,Number> sc = new ScatterChart<Number,Number>(xAxis,yAxis);
    // setup chart
    xAxis.setLabel("X Axis");
    yAxis.setLabel("Y Axis");
    // add starting data
    for (int s=0;s<5;s++) {
        XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>();
        series.setName("Data Series "+s);
        for (int i=0; i<30; i++) series.getData().add(new XYChart.Data<Number, Number>(Math.random()*98, Math.random()*98));
        sc.getData().add(series);
    }
    return sc;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:AdvancedScatterChartSample.java

示例5: createChart

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected AreaChart<Number, Number> createChart() {
    NumberAxis xAxis = new NumberAxis();
    NumberAxis yAxis = new NumberAxis();
    AreaChart<Number,Number> ac = new AreaChart<Number,Number>(xAxis,yAxis);
    // setup chart
    ac.setTitle("Area Chart Example");
    xAxis.setLabel("X Axis");
    yAxis.setLabel("Y Axis");
    // add starting data
    for (int s=0;s<3;s++) {
        XYChart.Series<Number,Number> series = new XYChart.Series<Number,Number>();
        series.setName("Data Series "+s);
        double x = 0;
        while (x<95) {
            series.getData().add(new XYChart.Data<Number,Number>(x, Math.random()*99));
            x += 5 + (15*Math.random());
        }
        series.getData().add(new XYChart.Data<Number,Number>(99d, Math.random()*99));
        ac.getData().add(series);
    }
    return ac;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:23,代碼來源:AdvancedAreaChartSample.java

示例6: start

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
@Override public void start(Stage stage) {
    final NumberAxis xAxis = new NumberAxis();
    final NumberAxis yAxis = new NumberAxis();
    xAxis.setLabel(xName);
    yAxis.setLabel(yName);
    
    final LineChart<Number,Number> lineChart = new LineChart<Number,Number>(xAxis,yAxis);
            
    lineChart.setTitle(title);
                            
    XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>();
    for (int i=1; i<n+1; i++){
        series.getData().add(new XYChart.Data<Number, Number>(x[i], y[i]));
    }
    
    Scene scene  = new Scene(lineChart,800,600);
    lineChart.getData().add(series);
   
    stage.setScene(scene);
    stage.show();
}
 
開發者ID:roycan,項目名稱:cs131_finals_2016,代碼行數:22,代碼來源:Graph2.java

示例7: displayIndex

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private void displayIndex(Map<String, Double> resultIndex, String title, String header) {
    BaseDialog dialog = new BaseDialog(title, header);
    dialog.getDialogPane().setPrefSize(800, 600);
    dialog.getDialogPane().getButtonTypes().addAll(new ButtonType(Configuration.getBundle().getString("ui.actions.stats.close"), ButtonBar.ButtonData.CANCEL_CLOSE));

    // draw
    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis();
    final LineChart<String,Number> lineChart = new LineChart<>(xAxis, yAxis);
    lineChart.setTitle(title);
    lineChart.setLegendVisible(false);

    xAxis.setLabel(Configuration.getBundle().getString("ui.actions.stats.xaxis"));
    yAxis.setLabel(Configuration.getBundle().getString("ui.actions.readable.yaxis"));

    XYChart.Series<String, Number> series = new XYChart.Series();
    for(Map.Entry<String, Double> st:resultIndex.entrySet()) {
        series.getData().add(new XYChart.Data(st.getKey(), st.getValue()));
    }
    lineChart.getData().addAll(series);
    dialog.getDialogPane().setContent(lineChart);
    dialog.setResizable(true);
    dialog.showAndWait();
}
 
開發者ID:firm1,項目名稱:zest-writer,代碼行數:25,代碼來源:MenuController.java

示例8: createGraph

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private Node createGraph() { // create a graph node to be acted on by the controls.
  // setup graph
  NumberAxis xAxis = new NumberAxis(); xAxis.setLabel("X Axis");
  NumberAxis yAxis = new NumberAxis(); yAxis.setLabel("Y Axis");
  LineChart<Number,Number> graph = new LineChart<Number,Number>(xAxis,yAxis);
  graph.setTitle("Test Graph");
  graph.setCreateSymbols(false);

  // add starting data
  XYChart.Series<Number,Number> series = new XYChart.Series<Number,Number>();
  series.setName("Squares");
  for (int x = 0; x <= 10; x++) series.getData().add(new XYChart.Data<Number,Number>(x, x * x));
  graph.getData().add(series);

  graph.setMinSize(300, 260);
  graph.setMaxSize(300, 260);

  //return graph;
  
  return new Circos(new long[]{34,56,90, 65, 10}, null, null);
}
 
開發者ID:paolopavan,項目名稱:circosFX,代碼行數:22,代碼來源:CenteredNodeInScrollPaneExample.java

示例9: handleFirstLoginsChart

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private void handleFirstLoginsChart() throws IOException, InterruptedException, ExecutionException {
    FutureRequest<LinkedHashMap<LocalDateTime, Integer>> requestResult = sock.submit(new NewPlayerLoginsRequest(
            startDatePicker.getValue(),
            endDatePicker.getValue().plusDays(1)
    ));

    LinkedHashMap<LocalDateTime, Integer> counts = requestResult.get();
    XYChart.Series<String, Number> series = new XYChart.Series<>();
    for(Map.Entry<LocalDateTime, Integer> e : counts.entrySet()) {
        series.getData().add(new XYChart.Data(e.getKey().toString(), e.getValue()));
    }
    series.setName("New Players");
    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis();
    xAxis.setLabel("Time Joined");
    yAxis.setLabel("Players Joined");
    yAxis.setTickLength(5);
    yAxis.setMinorTickLength(1);
    xAxis.setAutoRanging(true);
    final BarChart<String, Number> barChart = new BarChart<>(xAxis, yAxis);
    barChart.setTitle("New Players");
    barChart.getData().add(series);

    chartPane.setCenter(barChart);
    chartPane.layout();
}
 
開發者ID:jmhertlein,項目名稱:mcanalytics,代碼行數:27,代碼來源:ChartPane.java

示例10: createChart

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected ScatterChart<Number, Number> createChart() {
    final NumberAxis xAxis = new NumberAxis();
    xAxis.setSide(Side.TOP);
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setSide(Side.RIGHT);
    final ScatterChart<Number,Number> sc = new ScatterChart<Number,Number>(xAxis,yAxis);
    // setup chart
    xAxis.setLabel("X Axis");
    yAxis.setLabel("Y Axis");
    // add starting data
    for (int s=0;s<5;s++) {
        XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>();
        series.setName("Data Series "+s);
        for (int i=0; i<30; i++) series.getData().add(new XYChart.Data<Number, Number>(Math.random()*98, Math.random()*98));
        sc.getData().add(series);
    }

    return sc;
}
 
開發者ID:amoAHCP,項目名稱:JavaOne2015JavaFXPitfalls,代碼行數:20,代碼來源:AdvancedSimpleScatterChartSample.java

示例11: createChart

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
protected LineChart<Number, Number> createChart() {
    final NumberAxis xAxis = new NumberAxis();
    final NumberAxis yAxis = new NumberAxis();
    final LineChart<Number,Number> lc = new LineChart<Number,Number>(xAxis,yAxis);
    // setup chart
    lc.setTitle("Basic LineChart");
    xAxis.setLabel("X Axis");
    yAxis.setLabel("Y Axis");
    // add starting data
    XYChart.Series<Number,Number> series = new XYChart.Series<Number,Number>();
    series.setName("Data Series 1");
    series.getData().add(new XYChart.Data<Number,Number>(20d, 50d));
    series.getData().add(new XYChart.Data<Number,Number>(40d, 80d));
    series.getData().add(new XYChart.Data<Number,Number>(50d, 90d));
    series.getData().add(new XYChart.Data<Number,Number>(70d, 30d));
    series.getData().add(new XYChart.Data<Number,Number>(170d, 122d));
    lc.getData().add(series);
    return lc;
}
 
開發者ID:eugenkiss,項目名稱:kotlinfx-ensemble,代碼行數:20,代碼來源:AdvancedLineChartSample.java

示例12: 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;
   }
 
開發者ID:knr1,項目名稱:ch.bfh.mobicomp,代碼行數:17,代碼來源:AltitudeProfileView.java

示例13: SinChartComponent

import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
public SinChartComponent() {

    NumberAxis xAxis = new NumberAxis();
    xAxis.setLabel("x");

    NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("y");

    XYChart.Series<Number, Number> series = new XYChart.Series<>();
    series.setName("Sine");

    ObservableList<XYChart.Data<Number, Number>> data = series.getData();

    for (double x = -Math.PI; x < Math.PI; x += 0.5) {
      data.add(new XYChart.Data<Number, Number>(x, 10 * Math.sin(x)));
    }

    LineChart<Number, Number> lineChart = new LineChart<Number, Number>(xAxis, yAxis);
    lineChart.setTitle("Sine function");
    lineChart.getData().add(series);

    getChildren().add(lineChart);
  }
 
開發者ID:thomasdarimont,項目名稱:spring-labs,代碼行數:24,代碼來源:SinChartComponent.java

示例14: 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;
}
 
開發者ID:knr1,項目名稱:ch.bfh.mobicomp,代碼行數:17,代碼來源:EstimatedAltitudeProfileView.java

示例15: 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;
}
 
開發者ID:knr1,項目名稱:ch.bfh.mobicomp,代碼行數:17,代碼來源:ErrorProfileView.java


注:本文中的javafx.scene.chart.NumberAxis.setLabel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。