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


Java StackedAreaChart类代码示例

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


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

示例1: StackedAreaChartClass

import javafx.scene.chart.StackedAreaChart; //导入依赖的package包/类
/**
 * the constructor is responsible for initialize the chart (lower and upper buonds, name, colors)
 * @param stackedAreaChart is the type of chart for battery performance
 */
public StackedAreaChartClass(StackedAreaChart stackedAreaChart){
    NumberAxis yaxis = (NumberAxis) stackedAreaChart.getYAxis();

    //getter and setting proprieties for y and x axes
    xAxis = (NumberAxis) stackedAreaChart.getXAxis();
    xAxis.setLowerBound(0);
    xAxis.setUpperBound(10);
    xAxis.setAutoRanging(false);
    xAxis.setTickLabelsVisible(false); //hide numbers on x axis
    stackedAreaChart.setVerticalGridLinesVisible(false);//hide vertical lines
    stackedAreaChart.animatedProperty().setValue(false);
    yaxis.setAutoRanging(false);
    yaxis.setLowerBound(0);
    yaxis.setUpperBound(100);

    //set series of content to draw chart
    series = new XYChart.Series();
    series.setName("Battery level");
    stackedAreaChart.getData().add(series);

    //setting colors of charts
    Node fill = series.getNode().lookup(".chart-series-area-fill");
    fill.setStyle("-fx-fill: #fff7ad;");
    Node line = series.getNode().lookup(".chart-series-area-line");
    line.setStyle("-fx-stroke: #8bc34a;" +
            "-fx-stroke-width: 3px;"); // set width of line
    stackedAreaChart.setStyle("CHART_COLOR_1: #8bc34a;"); //color of dots
}
 
开发者ID:andrea9293,项目名称:pcstatus,代码行数:33,代码来源:StackedAreaChartClass.java

示例2: getNewChartInstance

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

示例3: createSymbolsPropertyTest

import javafx.scene.chart.StackedAreaChart; //导入依赖的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

示例4: buildChart

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

示例5: testGetStackedAreaChartAdjuster

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

示例6: createXYChart

import javafx.scene.chart.StackedAreaChart; //导入依赖的package包/类
@Override
protected XYChart<String, Number> createXYChart() {
    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis();
    final XYChart<String, Number> chart = new StackedAreaChart<String, Number>(xAxis, yAxis);
    chart.getStyleClass().add("chart-extension");
    return chart;
}
 
开发者ID:asciidocfx,项目名称:AsciidocFX,代码行数:9,代码来源:StackedAreaChartBuilderService.java

示例7: StackedAreaChartSample

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

示例8: createObject

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

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

示例9: getNewChart

import javafx.scene.chart.StackedAreaChart; //导入依赖的package包/类
public StackedAreaChart getNewChart() {
    StackedAreaChart chart = new StackedAreaChart(axis1, axis2);
    chart.setTitle("StackedAreaChart");
    chart.setStyle("-fx-border-color: darkgray;");
    return chart;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:7,代码来源:NewStackedAreaChartApp.java


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