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


Java AreaChart类代码示例

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


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

示例1: createChart

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
protected AreaChart<Number, Number> createChart() {
    NumberAxis xAxis = new NumberAxis();
    NumberAxis yAxis = new NumberAxis();
    AreaChart<Number,Number> ac = new AreaChart<Number,Number>(xAxis,yAxis);
    // setup chart
    ac.setTitle("Area Chart Example");
    xAxis.setLabel("X Axis");
    yAxis.setLabel("Y Axis");
    // add starting data
    for (int s=0;s<3;s++) {
        XYChart.Series<Number,Number> series = new XYChart.Series<Number,Number>();
        series.setName("Data Series "+s);
        double x = 0;
        while (x<95) {
            series.getData().add(new XYChart.Data<Number,Number>(x, Math.random()*99));
            x += 5 + (15*Math.random());
        }
        series.getData().add(new XYChart.Data<Number,Number>(99d, Math.random()*99));
        ac.getData().add(series);
    }
    return ac;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ChartAdvancedArea.java

示例2: createChart

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
protected AreaChart<Number,Number> createChart() {
    final NumberAxis xAxis = new NumberAxis(0,128,8);
    final NumberAxis yAxis = new NumberAxis(0,50,10);
    final AreaChart<Number,Number> ac = new AreaChart<Number,Number>(xAxis,yAxis);
    // setup chart
    ac.setId("audioAreaDemo");
    ac.setLegendVisible(false);
    ac.setTitle("Live Audio Spectrum Data");
    ac.setAnimated(false);
    xAxis.setLabel("Frequency Bands");
    yAxis.setLabel("Magnitudes");
    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis,null,"dB"));
    // add starting data
    XYChart.Series<Number,Number> series = new XYChart.Series<Number,Number>();
    series.setName("Audio Spectrum");
    //noinspection unchecked
    series1Data = new XYChart.Data[(int)xAxis.getUpperBound()];
    for (int i=0; i<series1Data.length; i++) {
        series1Data[i] = new XYChart.Data<Number,Number>(i,50);
        series.getData().add(series1Data[i]);
    }
    ac.getData().add(series);
    return ac;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:ChartAudioArea.java

示例3: createChart

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
private void createChart() {
    xAxis = new NumberAxis();
    xAxis.setForceZeroInRange(false);
    xAxis.setAutoRanging(true);

    NumberAxis yAxis = new NumberAxis();
    yAxis.setForceZeroInRange(false);
    yAxis.setAutoRanging(true);
    yAxis.setLabel(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode()));
    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis, "", ""));

    seriesBuy = new XYChart.Series<>();
    seriesSell = new XYChart.Series<>();

    areaChart = new AreaChart<>(xAxis, yAxis);
    areaChart.setLegendVisible(false);
    areaChart.setAnimated(false);
    areaChart.setId("charts");
    areaChart.setMinHeight(300);
    areaChart.setPrefHeight(300);
    areaChart.setPadding(new Insets(0, 30, 0, 0));
    areaChart.getData().addAll(seriesBuy, seriesSell);
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:24,代码来源:OfferBookChartView.java

示例4: addDataToSeriesOriginal

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
private void addDataToSeriesOriginal() 
{
    // add 20 numbers to the plot+
    for(int i = 0; i < 20; i++) 
    { 
        if( internalTemperatureMessageQueue.isEmpty() ) 
        {
            break;
        }
               
        AreaChart.Data data = new AreaChart.Data(xSeriesData++, internalTemperatureMessageQueue.remove());
        internalTemperatureSeries.getData().add(data);
    }
    
    // remove points to keep us at no more than MAX_DATA_POINTS
    if(internalTemperatureSeries.getData().size() > MAX_DATA_POINTS) 
    {
        internalTemperatureSeries.getData().remove(0, internalTemperatureSeries.getData().size() - MAX_DATA_POINTS);
    }
    
    // update 
    xAxis.setLowerBound(xSeriesData-MAX_DATA_POINTS);
    xAxis.setUpperBound(xSeriesData-1);
}
 
开发者ID:onebeartoe,项目名称:lizard-enclosure,代码行数:25,代码来源:SensorReadingsVisualizer.java

示例5: addDataItem

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
/**Add date item to chart
 *@param AreaChart<Number,Number>
 *@param String the sensor id
 **/
public static void addDataItem(AreaChart<Number,Number> ac, String sensor)
{
    ObservableList<XYChart.Series<Number, Number>> data = ac.getData();
    if (!data.isEmpty()) 
    {
        for(int i=0;i<data.size();i++)
        {
            XYChart.Series<Number, Number> s = data.get(i);
            if(s.getName().equals(sensor))
            {
               if(s!=null)
                //not implemented yet
                break;
            }
        }
    }
}
 
开发者ID:obdq,项目名称:obdq,代码行数:22,代码来源:GraphPageController.java

示例6: AreaChartSample

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
public AreaChartSample() {
    NumberAxis xAxis = new NumberAxis("X Values", 1.0d, 9.0d, 2.0d);
    xAxis.setTickLength(12.0f);
    NumberAxis yAxis = new NumberAxis("Y Values", 0.0d, 10.0d, 2.0d);
    ObservableList<AreaChart.Series> areaChartData = FXCollections.observableArrayList(
            new AreaChart.Series("Series 1",FXCollections.observableArrayList(
                new AreaChart.Data(0,4),
                new AreaChart.Data(2,5),
                new AreaChart.Data(4,4),
                new AreaChart.Data(6,2),
                new AreaChart.Data(8,6),
                new AreaChart.Data(10,8)
            )),
            new AreaChart.Series("Series 2", FXCollections.observableArrayList(
                new AreaChart.Data(0,8),
                new AreaChart.Data(2,2),
                new AreaChart.Data(4,9),
                new AreaChart.Data(6,7),
                new AreaChart.Data(8,5),
                new AreaChart.Data(10,7)
            )),
            new AreaChart.Series("Series 3", FXCollections.observableArrayList(
                new AreaChart.Data(0,2),
                new AreaChart.Data(2,5),
                new AreaChart.Data(4,8),
                new AreaChart.Data(6,6),
                new AreaChart.Data(8,9),
                new AreaChart.Data(10,7)
            ))
    );
    AreaChart chart = new AreaChart(xAxis, yAxis, areaChartData);
    getChildren().add(chart);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:34,代码来源:AreaChartSample.java

示例7: AreaChartControl

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
public AreaChartControl(String name) {
	super(name, FlashboardSendableType.AREACHART);
	
	axisX = new NumberAxis();
	axisX.setForceZeroInRange(false);
	axisX.setAutoRanging(false);
	axisX.setUpperBound(maxX);
	axisX.setLowerBound(minX);
	axisY = new NumberAxis();
	axisY.setForceZeroInRange(false);
	axisY.setAutoRanging(false);
	axisY.setUpperBound(maxY);
	axisY.setLowerBound(minY);
	
	chart = new AreaChart<Number, Number>(axisX, axisY);
	chart.setLegendVisible(false);
	chart.setAnimated(false);
	
	chartSeries = new AreaChart.Series<Number, Number>();
	chart.setTitle(name);
	chart.getData().add(chartSeries);
	
	root = new VBox();
	root.setAlignment(Pos.CENTER);
	root.setMaxSize(WIDTH, HEIGHT);
	root.getChildren().add(chart);
}
 
开发者ID:Flash3388,项目名称:FlashLib,代码行数:28,代码来源:AreaChartControl.java

示例8: createObject

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
protected Chart createObject(Axis x_axis, Axis y_axis, double width, double height) {

        Series s1 = new Series( FXCollections.observableArrayList(
                    new XYChart.Data(1,4),
                    new XYChart.Data(2,5),
                    new XYChart.Data(3,6)
                ));
        s1.setName("Set 1");
        Series s2 = new Series( FXCollections.observableArrayList(
                    new XYChart.Data(4,4),
                    new XYChart.Data(5,3),
                    new XYChart.Data(6,2)
                ));
        s2.setName("Set 2");
        Series s3 = new Series( FXCollections.observableArrayList(
                    new XYChart.Data(7,4),
                    new XYChart.Data(8,6),
                    new XYChart.Data(9,8)
                ));
        s3.setName("Set 3");
        ObservableList data = FXCollections.observableArrayList(s1, s2, s3);
        AreaChart chart = new AreaChart(x_axis, y_axis, data);
        chart.setMaxSize(width, height);
        chart.setPrefSize(width, height);
        chart.setTitle("AreaChart");
        chart.setStyle("-fx-border-color: darkgray;");
        return chart;
    }
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:29,代码来源:AreaChartApp.java

示例9: getNewChartInstance

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
@Override
protected Chart getNewChartInstance() {
    NumberAxis axis1 = new NumberAxis(0, 100, 10);
    NumberAxis axis2 = new NumberAxis(0, 100, 10);
    AreaChart chart = new AreaChart(axis1, axis2);
    return chart;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:8,代码来源:AreaChartTest.java

示例10: createSymbolsPropertyTest

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
@Test(timeout = 60000)
public void createSymbolsPropertyTest() {
    assertTrue(new AreaChart(new NumberAxis(), new NumberAxis()).getCreateSymbols());
    assertTrue(new StackedAreaChart(new NumberAxis(), new NumberAxis()).getCreateSymbols());
    populateChart();

    checkTextFieldText(AreaTestsProperties.createSymbols, "true");
    checkDotsCount(30);

    setPropertyByToggleClick(SettingType.BIDIRECTIONAL, AreaTestsProperties.createSymbols, false);
    checkTextFieldText(AreaTestsProperties.createSymbols, "false");
    checkDotsCount(0);

    setPropertyByToggleClick(SettingType.SETTER, AreaTestsProperties.createSymbols, true);
    checkTextFieldText(AreaTestsProperties.createSymbols, "true");
    checkDotsCount(30);

    setPropertyByToggleClick(SettingType.UNIDIRECTIONAL, AreaTestsProperties.createSymbols, false);
    checkTextFieldText(AreaTestsProperties.createSymbols, "false");
    checkDotsCount(0);

    removeFromIndex(2, 1, 0);
    checkDotsCount(0);

    setPropertyByToggleClick(SettingType.UNIDIRECTIONAL, AreaTestsProperties.createSymbols, true);

    addSeries("Series C", 0, 100, 30);
    checkDotsCount(30);

    removeFromIndex(0);
    checkDotsCount(0);

    setPropertyByToggleClick(SettingType.UNIDIRECTIONAL, AreaTestsProperties.createSymbols, false);

    checkDotsCount(0);
    addSeries("Series C", 0, 100, 30);

    checkDotsCount(0);
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:40,代码来源:AreaStackedAreaChartsCommon.java

示例11: GPXTrackviewer

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
private GPXTrackviewer() {
    myMapView = new MapView();
    myMapView.setZoom(0); 
    myGPXWaypointLayer = new GPXWaypointLayer();
    myMapView.addLayer(myGPXWaypointLayer);
    myMapView.setVisible(false);
    myMapView.setCursor(Cursor.CROSSHAIR);

    final NumberAxis xAxis = new NumberAxis();
    final NumberAxis yAxis = new NumberAxis();
    myAreaChart = new AreaChart(xAxis, yAxis);
    myAreaChart.setLegendVisible(false);
    myAreaChart.setVisible(false);
    myAreaChart.setCursor(Cursor.CROSSHAIR);
}
 
开发者ID:ThomasDaheim,项目名称:GPXEditor,代码行数:16,代码来源:GPXTrackviewer.java

示例12: buildChart

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
@Override
protected XYChart<ZonedDateTime, Double> buildChart(ZonedDateTimeAxis xAxis, ValueAxis<Double> yAxis, BooleanProperty showSymbolsProperty) {
    AreaChart<ZonedDateTime, Double> newChart = new AreaChart<>(xAxis, yAxis);
    newChart.setCreateSymbols(false);
    newChart.createSymbolsProperty().bindBidirectional(showSymbolsProperty);
    return newChart;
}
 
开发者ID:fthevenet,项目名称:binjr,代码行数:8,代码来源:AreaChartWorksheetController.java

示例13: createElevationViewNode

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
/**
 * creates the Node that contans the elevation data.
 *
 * @return
 */
private Node createElevationViewNode() {
    // in front of the label is the chart
    NumberAxis xAxis = new NumberAxis();
    xAxis.setForceZeroInRange(false);
    xAxis.setAnimated(false);
    NumberAxis yAxis = new NumberAxis();
    yAxis.setForceZeroInRange(false);
    yAxis.setAnimated(false);
    elevationChart = new AreaChart<>(xAxis, yAxis);
    elevationChart.setCreateSymbols(false);
    // if the chart is set to animated, we get error message son the console when adding data
    elevationChart.setAnimated(false);
    return elevationChart;
}
 
开发者ID:sothawo,项目名称:trakxmap,代码行数:20,代码来源:TrakxmapApp.java

示例14: testGetAreaChartAdjuster

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
@Test
public void testGetAreaChartAdjuster() {
	Adjuster adjuster = Adjuster.getAdjuster(AreaChart.class);
	
	assertThat(adjuster, is(instanceOf(RegionAdjuster.class)));
	assertThat(adjuster.getNodeClass(), is(sameInstance(Region.class)));
}
 
开发者ID:yumix,项目名称:javafx-dpi-scaling,代码行数:8,代码来源:AdjusterTest.java

示例15: addDataToSeries

import javafx.scene.chart.AreaChart; //导入依赖的package包/类
private void addDataToSeries() {
        for (int i = 0; i < 50; i++) {
            if (stockDataQueue.isEmpty()) break;
            stockPriceSeries.getData().add(new AreaChart.Data(xSeriesDataStock++, stockDataQueue.remove()));
                        
            if (predictionDataQueue.isEmpty() || emaDataQueue.isEmpty()) break;
            predictionSeries.getData().add(new AreaChart.Data(xSeriesDataPrediction, predictionDataQueue.remove()));
            emaPriceSeries.getData().add(new AreaChart.Data(xSeriesDataPrediction, emaDataQueue.remove()));
            xSeriesDataPrediction++;
            
//            series3.getData().add(new AreaChart.Data(xSeriesData++, dataQ3.remove()));
        }
        // remove points to keep us at no more than MAX_DATA_POINTS
        
        if (stockPriceSeries.getData().size() > MAX_DATA_POINTS) {
            stockPriceSeries.getData().remove(0, stockPriceSeries.getData().size() - MAX_DATA_POINTS);
        }
        if (predictionSeries.getData().size() > MAX_DATA_POINTS) {
            predictionSeries.getData().remove(0, predictionSeries.getData().size() - MAX_DATA_POINTS);
        }
        
        if (emaPriceSeries.getData().size() > MAX_DATA_POINTS) {
            emaPriceSeries.getData().remove(0, emaPriceSeries.getData().size() - MAX_DATA_POINTS);
        }

        xAxis.setLowerBound(xSeriesDataPrediction - MAX_DATA_POINTS);
        xAxis.setUpperBound(xSeriesDataStock - 1);
           
        
    }
 
开发者ID:Pivotal-Open-Source-Hub,项目名称:StockInference-Spark,代码行数:31,代码来源:FinanceUI.java


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