本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}