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


Java AreaChart.Series方法代码示例

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


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

示例1: 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

示例2: 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

示例3: initialize

import javafx.scene.chart.AreaChart; //导入方法依赖的package包/类
private void initialize(Stage primaryStage) 
{
    logger = Logger.getLogger(getClass().getName());
    
    xAxis = new NumberAxis(0,MAX_DATA_POINTS,MAX_DATA_POINTS/10);
    xAxis.setForceZeroInRange(false);
    xAxis.setAutoRanging(false);
    
    NumberAxis yAxis = new NumberAxis();
    yAxis.setAutoRanging(true);

    // Chart
    final AreaChart<Number, Number> sc = new AreaChart<Number, Number>(xAxis, yAxis) 
    {
        @Override 
        protected void dataItemAdded(Series<Number, Number> series, int itemIndex, Data<Number, Number> item) 
        {
            ; // This method is overriden with empty statement, to remove symbols on each data point.
        }
    };
    sc.setAnimated(false);
    sc.setId("liveAreaChart");
    sc.setTitle("Lizard Enclosure Sensor Readings");

    // internal temperature Series
    internalTemperatureSeries = new AreaChart.Series<Number, Number>();
    internalTemperatureSeries.setName("Internal Temperature");
    sc.getData().add(internalTemperatureSeries);        
    
    externalTemperatureSeries = new AreaChart.Series<Number, Number>();
    externalTemperatureSeries.setName("External Temperature");
    sc.getData().add(externalTemperatureSeries);
    
    internalHumiditySeries = new AreaChart.Series<Number, Number>();
    internalHumiditySeries.setName("Internal Humidity");
    sc.getData().add(internalHumiditySeries);

    primaryStage.setScene(new Scene(sc));
    
    primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() 
    {
        @Override
        public void handle(WindowEvent t) 
        {
            Platform.exit();
            System.exit(0);
        }
    });
}
 
开发者ID:onebeartoe,项目名称:lizard-enclosure,代码行数:50,代码来源:SensorReadingsVisualizer.java

示例4: handleChartChangeEvent

import javafx.scene.chart.AreaChart; //导入方法依赖的package包/类
/**
 * Handles the events responsible of changing the chart view
 * @param boolean initiateSliders instructing the system to initiate the sliders
 **/
public static void handleChartChangeEvent(boolean initiateSliders )
{
    try
    {
        removeAllAreaChartSeries(Globals.areaChart);
        int seriesLength=Globals.graphObj.getHeaders().size();
        String time=Globals.graphObj.getHeaders().get(0);
        for(int s=1;s<seriesLength;s++)
        {
            String sensorName=Globals.graphObj.getHeaders().get(s);

            if((Boolean)Globals.graphObj.getCheckboxesStatus().get(sensorName))
            {
                String sensorUnit=Globals.graphObj.getUnits().get(s);
                String seriesNameLong=builSeriesName(sensorName, sensorUnit);


                int timeIndex=Globals.graphObj.getHeaderIndexForID(time); 
                int sensorIndex=Globals.graphObj.getHeaderIndexForID(sensorName); 

                ArrayList<HashMap> seriesData=Globals.graphObj.getSeries();
                AreaChart.Series<Number,Number> series = new AreaChart.Series<Number,Number>();
                series.setName(LN.getString(seriesNameLong));

                for(int i=0;i<seriesData.size();i++)
                {
                    double yVal =(Double)seriesData.get(i).get(sensorIndex);
                    double xVal =(Double)seriesData.get(i).get(timeIndex);
                    if(initiateSliders)
                    {
                    series.getData().add(new AreaChart.Data<Number,Number>(xVal, yVal));
                    updateSlidersLimits((int)xVal,(int)yVal); 
                    }
                    else if(xVal>=Globals.xFirst&&xVal<=Globals.xLast&&yVal>=Globals.yFirst&&yVal<=Globals.yLast)
                        series.getData().add(new AreaChart.Data<Number,Number>(xVal, yVal));
                }               
                addAreaChartSeries(Globals.areaChart,series);
            }
        }
    }
    catch(Exception e)
    {}
}
 
开发者ID:obdq,项目名称:obdq,代码行数:48,代码来源:GraphPageController.java

示例5: addAreaChartSeries

import javafx.scene.chart.AreaChart; //导入方法依赖的package包/类
/**Adds new data series to the specified area chart, on the specified index  
 *@param AreaChart<Number,Number> from which the series will be removed
 *@paramAreaChart.Series<Number,Number> the data series
 *@return void
 **/
public static void addAreaChartSeries(AreaChart<Number,Number> ac,AreaChart.Series<Number,Number> series)
{
    ac.getData().add(series);
}
 
开发者ID:obdq,项目名称:obdq,代码行数:10,代码来源:GraphPageController.java


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