本文整理匯總了Java中javafx.scene.chart.NumberAxis.setSide方法的典型用法代碼示例。如果您正苦於以下問題:Java NumberAxis.setSide方法的具體用法?Java NumberAxis.setSide怎麽用?Java NumberAxis.setSide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.chart.NumberAxis
的用法示例。
在下文中一共展示了NumberAxis.setSide方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
示例2: 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;
}
示例3: createIntegerTimingDiagram
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
/**
* Generates an integer timing diagram.
*
* @param concreteSpec the concrete specification which should be used to extract the needed
* information
* @param specIoVar the variable for which a diagram should be generated
* @param globalXAxis global x axis used for all diagrams
* @param selection selection that should be updated when hovering with mouse
* @param activated only update selection if true
* @return A {@link Pair} which holds a {@link TimingDiagramController} and a {@link NumberAxis}
*/
public static Pair<TimingDiagramController, Axis> createIntegerTimingDiagram(
ConcreteSpecification concreteSpec, ValidIoVariable specIoVar, NumberAxis globalXAxis,
Selection selection, BooleanProperty activated) {
NumberAxis yaxis = new NumberAxis(0, 10, 1);
yaxis.setPrefWidth(30);
yaxis.setSide(Side.LEFT);
yaxis.setTickLabelFormatter(new IntegerTickLabelConverter());
yaxis.setMinorTickVisible(false);
TimingDiagramController timingDiagramController = new TimingDiagramController(globalXAxis,
yaxis, concreteSpec, specIoVar, selection, activated);
return new ImmutablePair<>(timingDiagramController, yaxis);
}
示例4: createAxis
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
/**
* create a horizontal axis
*
* @param maxReadLength
* @return axis
*/
public static Pane createAxis(final ReadOnlyIntegerProperty maxReadLength, final ReadOnlyDoubleProperty widthProperty) {
final Pane pane = new Pane();
pane.prefWidthProperty().bind(widthProperty);
final NumberAxis axis = new NumberAxis();
axis.setSide(Side.TOP);
axis.setAutoRanging(false);
axis.setLowerBound(0);
axis.prefHeightProperty().set(20);
axis.prefWidthProperty().bind(widthProperty.subtract(60));
final ChangeListener<Number> changeListener = new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
int minX = Math.round(maxReadLength.get() / 2000.0f); // at most 2000 major ticks
for (int x = 10; x < 10000000; x *= 10) {
if (x >= minX && widthProperty.doubleValue() * x >= 50 * maxReadLength.doubleValue()) {
axis.setUpperBound(maxReadLength.get());
axis.setTickUnit(x);
return;
}
}
axis.setTickUnit(maxReadLength.get());
axis.setUpperBound(maxReadLength.get());
}
};
maxReadLength.addListener(changeListener);
widthProperty.addListener(changeListener);
pane.getChildren().add(axis);
return pane;
}
示例5: plotGraph
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private static Pane plotGraph(Pane root, LineGraph graph) {
if (!graph.isRendered())
graph.render(LineGraph.Render.ALL);
handleMapping(graph);
//The holder
AnchorPane pane = new AnchorPane();
//pane.setMaxSize(graph.getWidth(), graph.getHeight());
//pane.setPrefWidth(graph.getWidth());
//Add the graph
pane.getChildren().add(graph);
//Creates axises
NumberAxis xAxis = new NumberAxis(xStart, xEnd, xIncrement);
NumberAxis yAxis = new NumberAxis(yStart, yEnd, yIncrement);
yAxis.setSide(Side.LEFT);
pane.getChildren().add(xAxis);
pane.getChildren().add(yAxis);
//Add x-axis
if(labels.containsKey(graph.getId()))
xAxis.setLabel(labels.get(graph.getId())[0]);
AnchorPane.setLeftAnchor(xAxis, 68.0);
AnchorPane.setRightAnchor(xAxis, 5.0);
AnchorPane.setBottomAnchor(xAxis, 0.0);
AnchorPane.setLeftAnchor(graph,68.0);
//Add y-axis
if(labels.containsKey(graph.getId()))
yAxis.setLabel(labels.get(graph.getId())[1]);
AnchorPane.setLeftAnchor(yAxis, 0.0);
AnchorPane.setTopAnchor(yAxis, graph.getHeight() - graph.getRealMaxHeight());
//Setting margin of y-axis and graph related to the x-axis height
xAxis.heightProperty().addListener((observable,oldV,newV) -> {
AnchorPane.setBottomAnchor(yAxis,newV.doubleValue());
AnchorPane.setBottomAnchor(graph, newV.doubleValue());
});
Pane out;
if (root == null)
out = new Pane();
else
out = root;
out.getChildren().add(pane);
clear();
return out;
}