当前位置: 首页>>代码示例>>Java>>正文


Java NumberAxis.setTickMarkVisible方法代码示例

本文整理汇总了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);
}
 
开发者ID:AdrienGuille,项目名称:SONDY,代码行数:14,代码来源:EventDetectionUI.java

示例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);
}
 
开发者ID:AdrienGuille,项目名称:SONDY,代码行数:13,代码来源:InfluenceAnalysisUI.java

示例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();
}
 
开发者ID:YaSuenag,项目名称:ulviewer,代码行数:73,代码来源:PauseTimeChartViewer.java

示例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();
}
 
开发者ID:YaSuenag,项目名称:ulviewer,代码行数:50,代码来源:VMOperationChartViewer.java

示例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();
}
 
开发者ID:YaSuenag,项目名称:ulviewer,代码行数:73,代码来源:MetaspaceChartViewer.java

示例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));
    }
 
开发者ID:Pivotal-Open-Source-Hub,项目名称:StockInference-Spark,代码行数:52,代码来源:FinanceUI.java


注:本文中的javafx.scene.chart.NumberAxis.setTickMarkVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。