本文整理匯總了Java中javafx.scene.chart.NumberAxis.setTickMarkVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java NumberAxis.setTickMarkVisible方法的具體用法?Java NumberAxis.setTickMarkVisible怎麽用?Java NumberAxis.setTickMarkVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.chart.NumberAxis
的用法示例。
在下文中一共展示了NumberAxis.setTickMarkVisible方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initializeFrequencyChart
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
public final void initializeFrequencyChart(){
xAxis = new NumberAxis(0,1,1);
yAxis = new NumberAxis();
xAxis.setTickLength(5);
yAxis.setTickLabelsVisible(false);
yAxis.setTickMarkVisible(false);
xAxis.setLabel("Time (days)");
frequencyChart = new LineChart<>(xAxis,yAxis);
frequencyChart.setLegendVisible(true);
frequencyChart.setCreateSymbols(false);
frequencyChart.setTranslateX(-5);
UIUtils.setSize(frequencyChart, Main.columnWidthLEFT+5, 300);
}
示例2: initializeRankDistributionChart
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
public final void initializeRankDistributionChart(){
xAxis = new CategoryAxis();
yAxis = new NumberAxis();
xAxis.setLabel("Rank");
xAxis.setTickLength(5);
yAxis.setTickLabelsVisible(false);
yAxis.setTickMarkVisible(false);
rankDistributionChart = new BarChart(xAxis,yAxis);
rankDistributionChart.setLegendVisible(false);
UIUtils.setSize(rankDistributionChart, Main.columnWidthRIGHT+5, 300);
rankDistributionChart.setCategoryGap(0);
}
示例3: draw
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
@Override
public void draw() {
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
xAxis.setMinorTickVisible(false);
xAxis.setTickMarkVisible(false);
xAxis.setTickLabelsVisible(false);
xAxis.setAutoRanging(false);
yAxis.setMinorTickVisible(false);
yAxis.setTickMarkVisible(false);
yAxis.setLabel("ms");
XYChart.Series<Number, Number> youngSeries = new XYChart.Series<>();
XYChart.Series<Number, Number> concurrentSeries = new XYChart.Series<>();
XYChart.Series<Number, Number> fullSeries = new XYChart.Series<>();
ScatterChart<Number, Number> chart = new ScatterChart<Number, Number>(xAxis, yAxis, FXCollections.observableArrayList(youngSeries, concurrentSeries, fullSeries));
chart.setAnimated(false);
chart.setLegendVisible(false);
Stage stage = super.createStage(chart, "Pause time");
for(LogData log : super.logdata){
String phase;
double time;
if(!super.shouldProcess(log) || (log.getTags().size() != 1)){
continue;
}
long gcid = super.getGcId();
Matcher matcher = PAUSE_TIME_PATTERN.matcher(super.getLogBody());
if(!matcher.matches()){
continue;
}
phase = matcher.group(1);
time = Double.parseDouble(matcher.group(2));
LogTimeValue logTimeValue = LogTimeValue.getLogTimeValue(log, super.chartWizardController.getTimeRange());
XYChart.Data<Number, Number> data = new XYChart.Data<>(logTimeValue.getValue(), time);
if(phase.startsWith("Full")){
fullSeries.getData().add(data);
data.getNode().setStyle("-fx-background-color: black;");
}
else if(phase.startsWith("Young")) {
youngSeries.getData().add(data);
data.getNode().setStyle("-fx-background-color: skyblue;");
}
else{
concurrentSeries.getData().add(data);
data.getNode().setStyle("-fx-background-color: orange;");
}
data.getNode().addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipValue(logTimeValue.toString(), phase, gcid));
data.getNode().addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(super.gcEventList.get(gcid), "GC ID: " + gcid));
Tooltip.install(data.getNode(), tooltip);
}
if(youngSeries.getData().isEmpty() && concurrentSeries.getData().isEmpty() && fullSeries.getData().isEmpty()){
(new Alert(Alert.AlertType.ERROR, "No GC data", ButtonType.OK)).showAndWait();
return;
}
DoubleSummaryStatistics stats = Stream.concat(youngSeries.getData().stream(), Stream.concat(concurrentSeries.getData().stream(), fullSeries.getData().stream()))
.mapToDouble(d -> d.getXValue().doubleValue())
.summaryStatistics();
xAxis.setLowerBound(stats.getMin());
xAxis.setUpperBound(stats.getMax());
stage.show();
}
示例4: draw
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
@Override
public void draw() {
collectVmOpInfo();
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
xAxis.setMinorTickVisible(false);
xAxis.setTickMarkVisible(false);
xAxis.setTickLabelsVisible(false);
xAxis.setAutoRanging(false);
yAxis.setMinorTickVisible(false);
yAxis.setTickMarkVisible(false);
XYChart.Series<Number, Number> series = new XYChart.Series<>();
ScatterChart<Number, Number> chart = new ScatterChart<Number, Number>(xAxis, yAxis, FXCollections.observableArrayList(series));
chart.setAnimated(false);
chart.setLegendVisible(false);
Stage stage = super.createStage(chart, "VM Operations");
for(Map.Entry<LogTimeValue, List<LogData>> entry : vmOpMap.entrySet()){
double elapsedTime = LogTimeValue.getLogTimeValue(entry.getValue().get(entry.getValue().size() - 1), super.chartWizardController.getTimeRange()).getValue().doubleValue() - entry.getKey().getValue().doubleValue();
XYChart.Data<Number, Number> data = new XYChart.Data<>(entry.getKey().getValue(), elapsedTime);
series.getData().add(data);
Matcher matcher = VMOP_START_PATTERN.matcher(entry.getValue().get(0).getMessage());
matcher.matches();
String opName = matcher.group(2);
data.getNode().addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipText(entry.getKey().toString(), opName, elapsedTime));
data.getNode().addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(entry.getValue(), entry.getKey().toString() + ": " + opName));
Tooltip.install(data.getNode(), tooltip);
}
if(series.getData().isEmpty()){
(new Alert(Alert.AlertType.ERROR, "No VM Operation data", ButtonType.OK)).showAndWait();
return;
}
DoubleSummaryStatistics stats = series.getData()
.stream()
.mapToDouble(d -> d.getXValue().doubleValue())
.summaryStatistics();
xAxis.setLowerBound(stats.getMin());
xAxis.setUpperBound(stats.getMax());
stage.show();
}
示例5: draw
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
@Override
public void draw() {
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
xAxis.setMinorTickVisible(false);
xAxis.setTickMarkVisible(false);
xAxis.setTickLabelsVisible(false);
xAxis.setAutoRanging(false);
yAxis.setMinorTickVisible(false);
yAxis.setTickMarkVisible(false);
yAxis.setLabel("MB");
XYChart.Series<Number, Long> capacitySeries = new XYChart.Series<>();
XYChart.Series<Number, Long> usageSeries = new XYChart.Series<>();
AreaChart<Number, Long> chart = new AreaChart(xAxis, yAxis, FXCollections.observableArrayList(capacitySeries, usageSeries));
chart.setAnimated(false);
chart.setLegendVisible(false);
chart.lookup(".series0").setStyle("-fx-fill: red; -fx-stroke: red;"); // capacity
chart.lookup(".series1").setStyle("-fx-fill: blue; -fx-stroke: blue;"); // usage
Stage stage = super.createStage(chart, "Metaspace usage");
for(LogData log : super.logdata){
long capacity;
long usage;
if(!super.shouldProcess(log) || (log.getTags().size() != 2) || !log.getTags().contains("metaspace")){
continue;
}
long gcid = super.getGcId();
Matcher matcher = METASPACE_USAGE_PATTERN.matcher(super.getLogBody());
if(!matcher.matches()){
continue;
}
usage = Long.parseLong(matcher.group(1)) / 1024; // in MB
capacity = Long.parseLong(matcher.group(2)) / 1024; // in MB
LogTimeValue logTimeValue = LogTimeValue.getLogTimeValue(log, super.chartWizardController.getTimeRange());
XYChart.Data<Number, Long> capacityData = new XYChart.Data<>(logTimeValue.getValue(), capacity);
XYChart.Data<Number, Long> usageData = new XYChart.Data<>(logTimeValue.getValue(), usage);
capacitySeries.getData().add(capacityData);
usageSeries.getData().add(usageData);
Node capacityDataNode = capacityData.getNode();
Node usageDataNode = usageData.getNode();
capacityDataNode.lookup(".chart-area-symbol").setStyle(BASE_SYMBOL_STYLE + "-fx-background-color: white, red;");
usageDataNode.lookup(".chart-area-symbol").setStyle(BASE_SYMBOL_STYLE + "-fx-background-color: white, blue;");
capacityDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> capacityDataNode.setOpacity(1.0d));
capacityDataNode.addEventHandler(MouseEvent.MOUSE_EXITED_TARGET, e -> capacityDataNode.setOpacity(0.0d));
usageDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> usageDataNode.setOpacity(1.0d));
usageDataNode.addEventHandler(MouseEvent.MOUSE_EXITED_TARGET, e -> usageDataNode.setOpacity(0.0d));
capacityDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipValue(logTimeValue.toString(), capacity, usage, gcid));
usageDataNode.addEventHandler(MouseEvent.MOUSE_ENTERED_TARGET, e -> setTooltipValue(logTimeValue.toString(), capacity, usage, gcid));
capacityDataNode.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(super.gcEventList.get(gcid), "GC ID: " + gcid));
usageDataNode.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> super.showLogWindow(super.gcEventList.get(gcid), "GC ID: " + gcid));
Tooltip.install(capacityData.getNode(), tooltip);
Tooltip.install(usageData.getNode(), tooltip);
}
if(capacitySeries.getData().size() == 0){
(new Alert(Alert.AlertType.ERROR, "No GC data", ButtonType.OK)).showAndWait();
return;
}
xAxis.setLowerBound(capacitySeries.getData().get(0).getXValue().doubleValue());
xAxis.setUpperBound(capacitySeries.getData().get(capacitySeries.getData().size() - 1).getXValue().doubleValue());
stage.show();
}
示例6: init
import javafx.scene.chart.NumberAxis; //導入方法依賴的package包/類
private void init(Stage primaryStage) {
instance = this;
xAxis = new NumberAxis();
xAxis.setForceZeroInRange(false);
xAxis.setAutoRanging(true);
xAxis.setLabel("Time");
xAxis.setTickLabelsVisible(false);
xAxis.setTickMarkVisible(true);
xAxis.setMinorTickVisible(false);
yAxis = new NumberAxis();
yAxis.setAutoRanging(false);
yAxis.setForceZeroInRange(false);
//yAxis.setLowerBound(210.4);
//yAxis.setUpperBound(212);
yAxis.setLabel("Stock Price ($)");
//-- Chart
final LineChart<Number, Number> sc = new LineChart<Number, Number>(xAxis, yAxis) {
// Override to remove symbols on each data point
@Override
protected void dataItemAdded(Series<Number, Number> series, int itemIndex, Data<Number, Number> item) {
}
};
sc.setCursor(Cursor.CROSSHAIR);
sc.setAnimated(false);
sc.setId("stockChart");
// sc.setTitle("Stock Price");
//-- Chart Series
stockPriceSeries = new XYChart.Series<Number, Number>();
stockPriceSeries.setName("Last Close");
emaPriceSeries = new XYChart.Series<Number, Number>();
emaPriceSeries.setName("Med Avg");
predictionSeries = new XYChart.Series<Number, Number>();
predictionSeries.setName("Predicted Med Avg.");
sc.getData().addAll(stockPriceSeries, emaPriceSeries, predictionSeries);
sc.getStylesheets().add("style.css");
sc.applyCss();
primaryStage.setScene(new Scene(sc));
}