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


Java Axis.invalidateRange方法代码示例

本文整理汇总了Java中javafx.scene.chart.Axis.invalidateRange方法的典型用法代码示例。如果您正苦于以下问题:Java Axis.invalidateRange方法的具体用法?Java Axis.invalidateRange怎么用?Java Axis.invalidateRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.chart.Axis的用法示例。


在下文中一共展示了Axis.invalidateRange方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateAxisRange

import javafx.scene.chart.Axis; //导入方法依赖的package包/类
/**
 * This is called when the range has been invalidated and we need to update it. If the axis are auto
 * ranging then we compile a list of all data that the given axis has to plot and call invalidateRange() on the
 * axis passing it that data.
 */
@Override
protected void updateAxisRange() {
    // For candle stick chart we need to override this method as we need to let the axis know that they need to be able
    // to cover the whole area occupied by the high to low range not just its center data value
    final Axis<Number> xa = getXAxis();
    final Axis<Number> ya = getYAxis();
    List<Number> xData = null;
    List<Number> yData = null;
    if (xa.isAutoRanging()) {
        xData = new ArrayList<Number>();
    }
    if (ya.isAutoRanging()) {
        yData = new ArrayList<Number>();
    }
    if (xData != null || yData != null) {
        for (Series<Number, Number> series : getData()) {
            for (Data<Number, Number> data : series.getData()) {
                if (xData != null) {
                    xData.add(data.getXValue());
                }
                if (yData != null) {
                    CandleStickExtraValues extras = (CandleStickExtraValues) data.getExtraValue();
                    if (extras != null) {
                        yData.add(extras.getHigh());
                        yData.add(extras.getLow());
                    } else {
                        yData.add(data.getYValue());
                    }
                }
            }
        }
        if (xData != null) {
            xa.invalidateRange(xData);
        }
        if (yData != null) {
            ya.invalidateRange(yData);
        }
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:45,代码来源:AdvCandleStickChartSample.java

示例2: updateAxisRange

import javafx.scene.chart.Axis; //导入方法依赖的package包/类
@Override
protected void updateAxisRange() {
    final Axis<Number> xa = getXAxis();
    final Axis<Number> ya = getYAxis();
    List<Number> xData = null;
    List<Number> yData = null;
    if (xa.isAutoRanging()) {
        xData = new ArrayList<>();
    }
    if (ya.isAutoRanging())
        yData = new ArrayList<>();
    if (xData != null || yData != null) {
        for (XYChart.Series<Number, Number> series : getData()) {
            for (XYChart.Data<Number, Number> data : series.getData()) {
                if (xData != null) {
                    xData.add(data.getXValue());
                }
                if (yData != null)
                    yData.add(data.getYValue());
            }
        }
        if (xData != null) {
            xa.invalidateRange(xData);
        }
        if (yData != null) {
            ya.invalidateRange(yData);
        }
    }
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:30,代码来源:VolumeChart.java

示例3: updateAxisRange

import javafx.scene.chart.Axis; //导入方法依赖的package包/类
/**
 * This is called when the range has been invalidated and we need to update it. If the axis are auto
 * ranging then we compile a list of all data that the given axis has to plot and call invalidateRange() on the
 * axis passing it that data.
 */
@Override
protected void updateAxisRange() {
    // For candle stick chart we need to override this method as we need to let the axis know that they need to be able
    // to cover the whole area occupied by the high to low range not just its center data value
    final Axis<Number> xa = getXAxis();
    final Axis<Number> ya = getYAxis();
    List<Number> xData = null;
    List<Number> yData = null;
    if (xa.isAutoRanging()) {
        xData = new ArrayList<>();
    }
    if (ya.isAutoRanging()) {
        yData = new ArrayList<>();
    }
    if (xData != null || yData != null) {
        for (XYChart.Series<Number, Number> series : getData()) {
            for (XYChart.Data<Number, Number> data : series.getData()) {
                if (xData != null) {
                    xData.add(data.getXValue());
                }
                if (yData != null) {
                    if (data.getExtraValue() instanceof CandleData) {
                        CandleData candleData = (CandleData) data.getExtraValue();
                        yData.add(candleData.high);
                        yData.add(candleData.low);
                    } else {
                        yData.add(data.getYValue());
                    }
                }
            }
        }
        if (xData != null) {
            xa.invalidateRange(xData);
        }
        if (yData != null) {
            ya.invalidateRange(yData);
        }
    }
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:45,代码来源:CandleStickChart.java

示例4: updateAxisRange

import javafx.scene.chart.Axis; //导入方法依赖的package包/类
/**
 * This is called when the range has been invalidated and we need to update
 * it. If the axis are auto ranging then we compile a list of all data that
 * the given axis has to plot and call invalidateRange() on the axis passing
 * it that data.
 */
@Override
protected void updateAxisRange() {
        // For candle stick chart we need to override this method as we need to let the axis know that they need to be able
    // to cover the whole area occupied by the high to low range not just its center data value
    final Axis<String> xa = getXAxis();
    final Axis<Number> ya = getYAxis();
    List<String> xData = null;
    List<Number> yData = null;
    if (xa.isAutoRanging()) {
        xData = new ArrayList<String>();
    }
    if (ya.isAutoRanging()) {
        yData = new ArrayList<Number>();
    }
    if (xData != null || yData != null) {
        for (XYChart.Series<String, Number> series : getData()) {
            for (XYChart.Data<String, Number> data : series.getData()) {
                if (xData != null) {
                    xData.add(data.getXValue());
                }
                if (yData != null) {
                    CandleStickExtraValues extras = (CandleStickExtraValues) data.getExtraValue();
                    if (extras != null) {
                        yData.add(extras.getHigh());
                        yData.add(extras.getLow());
                    } else {
                        yData.add(data.getYValue());
                    }
                }
            }
        }
        if (xData != null) {
            xa.invalidateRange(xData);
        }
        if (yData != null) {
            ya.invalidateRange(yData);
        }
    }
}
 
开发者ID:softarts,项目名称:candy,代码行数:46,代码来源:CandleStickChart.java

示例5: updateAxisRange

import javafx.scene.chart.Axis; //导入方法依赖的package包/类
/**
 * This is called when the range has been invalidated and we need to update it. If the axis are auto
 * ranging then we compile a list of all data that the given axis has to plot and call invalidateRange() on the
 * axis passing it that data.
 */
@Override
protected void updateAxisRange() {
    // For candle stick chart we need to override this method as we need to let the axis know that they need to be able
    // to cover the whole area occupied by the high to low range not just its center data value
    final Axis<String> xa = getXAxis();
    final Axis<Number> ya = getYAxis();
    List<String> xData = null;
    List<Number> yData = null;
    if (xa.isAutoRanging()) {
        xData = new ArrayList<String>();
    }
    if (ya.isAutoRanging()) {
        yData = new ArrayList<Number>();
    }
    if (xData != null || yData != null) {
        for (XYChart.Series<String, Number> series : getData()) {
            for (XYChart.Data<String, Number> data : series.getData()) {
                if (xData != null) {
                    xData.add(data.getXValue());
                }
                if (yData != null) {
                    CandleStickExtraValues extras = (CandleStickExtraValues) data.getExtraValue();
                    if (extras != null) {
                        yData.add(extras.getHigh());
                        yData.add(extras.getLow());
                    } else {
                        yData.add(data.getYValue());
                    }
                }
            }
        }
        if (xData != null) {
            xa.invalidateRange(xData);
        }
        if (yData != null) {
            ya.invalidateRange(yData);
        }
    }
}
 
开发者ID:softarts,项目名称:candy,代码行数:45,代码来源:AdvTraderChart.java


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