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


Java PieChart.setTitle方法代码示例

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


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

示例1: start

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Europian Country Population");
    stage.setWidth(500);
    stage.setHeight(500);
 
    ObservableList<PieChart.Data> pieChartData =
            FXCollections.observableArrayList(
            new PieChart.Data("Belgium", 3),
            new PieChart.Data("France", 26),
            new PieChart.Data("Germany", 35),
            new PieChart.Data("Netherlands", 7),
            new PieChart.Data("Sweden", 4),
            new PieChart.Data("United Kingdom", 25));
    final PieChart pieChart = new PieChart(pieChartData);
    pieChart.setTitle("Country Population");

    ((Group) scene.getRoot()).getChildren().add(pieChart);
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:PacktPublishing,项目名称:Java-for-Data-Science,代码行数:23,代码来源:PieChart - MainApp.java

示例2: createPieChart

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
/** 
 * Creates a pie chart
 * 
 * @return {@link PieChart}
 */
private PieChart createPieChart() {
	PieChart chart = new PieChart();
	chart.setMinHeight(chartHeight);
	chart.setTitle("Time needed in mode");
	chart.setLegendVisible(false);
	chart.getStyleClass().add("statistic-chart");
	chart.getStyleClass().add("statistic-chart-pie");
	
	long[] durations = trackingSession.getDuration();
	
	PieChart.Data redData = new PieChart.Data("RED", durations[0]/1000.0);
	PieChart.Data greenData = new PieChart.Data("GREEN", durations[1]/1000.0);
	PieChart.Data blueData = new PieChart.Data("BLUE", durations[2]/1000.0);
	
	if(durations[0] != 0) {
		chart.getData().addAll(redData, greenData, blueData);
	}
	
	return chart;
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-null,代码行数:26,代码来源:TrackingStatistic.java

示例3: root_center

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
public PieChart root_center(){
	List<Event> startEvents= EventHandler.getPhaseStartEvents();
	int test = 0;
	int code = 0;
	int ref  = 0;
	for(Event e : startEvents){
		switch(((PhaseStartEvent)e).getPhase()){
			case 0: test = test+((PhaseStartEvent)e).getDuration();break;
			case 1: code = code+((PhaseStartEvent)e).getDuration();break;
			case 2: ref = ref+((PhaseStartEvent)e).getDuration();break;
		}
	}
	ObservableList<PieChart.Data> pieChartData =
               FXCollections.observableArrayList(
               new PieChart.Data("Test", test),
               new PieChart.Data("Code", code),
               new PieChart.Data("Refactor", ref));
       PieChart chart = new PieChart(pieChartData);
       chart.setTitle("Time per phase:");
       
	return chart;
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-team-1,代码行数:23,代码来源:StatisticStage.java

示例4: initChart

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
/**
 * Generate pipe chart
 */
private void initChart() {
    PieChart.Data available = new PieChart.Data("Available", 13);
    PieChart.Data used = new PieChart.Data("Used", 25);
    PieChart.Data empty = new PieChart.Data("Empty", 10);


    ObservableList<PieChart.Data> pieChartData =
            FXCollections.observableArrayList(available, used, empty);
    final PieChart chart = new PieChart(pieChartData);
    chart.setTitle("");
    chart.setPrefSize(350, 350);
    chart.setLegendVisible(false);
    chart.setStyle("-fx-background-color: none");
    pieChartPane.getChildren().add(chart);

    available.getNode().setStyle("-fx-background-color: #55c4fe");
    used.getNode().setStyle("-fx-background-color: #008287");
    empty.getNode().setStyle("-fx-background-color: #219297");

}
 
开发者ID:StnetixDevTeam,项目名称:ariADDna,代码行数:24,代码来源:CloudSettingsController.java

示例5: erstellePieChart

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
/**
    * This method is used to create a PieChart out of the information we got from
    * @see #leseZeiten(int) .
    * @return The created PieChart which contains the gathered information.
    */
   private PieChart erstellePieChart() {
	ObservableList<PieChart.Data> daten = FXCollections.observableArrayList(
               new PieChart.Data("Red " + leseZeiten(1) + " Sekunden", leseZeiten(1)),                	
               new PieChart.Data("Green " + leseZeiten(2) + " Sekunden", leseZeiten(2)),	                
               new PieChart.Data("Refactor " + leseZeiten(3) + " Sekunden", leseZeiten(3)));
       PieChart pieChart = new PieChart(daten);
       pieChart.setTitle(gebeProzenteAus());
              
       int i = 0;        
       for (PieChart.Data data : daten) {
       	if(i == 0) data.getNode().setStyle("-fx-pie-color: #FF0000;");
       	if(i == 1) data.getNode().setStyle("-fx-pie-color: #008000;");
       	if(i == 2) data.getNode().setStyle("-fx-pie-color: #000000;");
           i++;
       }         
       
       pieChart.setClockwise(false);
       pieChart.setStartAngle(180);
       return pieChart;
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-nimmdochirgendeinennamen,代码行数:26,代码来源:TrackingChart.java

示例6: getSystemPanel

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
private HBox getSystemPanel() {
    ObservableList<PieChart.Data> pieChartData =
            FXCollections.observableArrayList();
    CONNECTIONS.forEach((string, clientObject) -> {
        if (clientObject.getSYSTEM_OS() != null) {
            if (operatingSystems.containsKey(clientObject.getSYSTEM_OS())) {
                operatingSystems.put(clientObject.getSYSTEM_OS(), operatingSystems.get(clientObject.getSYSTEM_OS()) + 1);
            } else {
                operatingSystems.put(clientObject.getSYSTEM_OS(), 1);
            }
        }
    });
    operatingSystems.forEach((string, integer) -> {
        pieChartData.add(new PieChart.Data(string, CONNECTIONS.size() / integer));
    });
    final PieChart chart = new PieChart(pieChartData);
    chart.setLegendVisible(false);
    chart.setTitle("Operating Systems");
    chart.setMaxSize(300, 300);
    return Styler.hContainer(Styler.vContainer(10, chart));
}
 
开发者ID:Ghosts,项目名称:Maus,代码行数:22,代码来源:StatisticsView.java

示例7: getChartInfos

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
public String getChartInfos(PieChart chart,char Phase) {
    actualPhase = Phase;
    stopTime(Phase);
    elapsedTimed=System.currentTimeMillis()-(StartTime+trackerTime);
    RedTimeInPreCent = Math.round(((double) RedTime/elapsedTimed)*100);
    GreenTimeInPreCent = Math.round(((double) GreenTime/elapsedTimed)*100);
    RefactorTimeInPreCent = Math.round(((double) RefactorTime/elapsedTimed)*100);
    ExtraInfo=setExtraInfo();
    ObservableList<PieChart.Data> pieChartData =
            FXCollections.observableArrayList(
                    new PieChart.Data("RED-Time", RedTimeInPreCent),
                    new PieChart.Data("GREEN-Time", GreenTimeInPreCent),
                    new PieChart.Data("REFACTOR-Time", RefactorTimeInPreCent));
    chart.setData(pieChartData);
    chart.setTitle("Phase Duration");
    return getTrackingStats();
}
 
开发者ID:ProPra16,项目名称:programmierpraktikum-abschlussprojekt-halt-doch-einfach-mal-dein-maul,代码行数:18,代码来源:TrackingUnit.java

示例8: addAdditionalStatistics

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
@Override
protected void addAdditionalStatistics(VBox statisticsView, WorklogStatistics statistics, List<TaskWithWorklogs> displayResult) {
    super.addAdditionalStatistics(statisticsView, statistics, displayResult);

    if (statistics.getEmployeeToProjectToWorktime().size() > 0) {
        PieChart pieChart = new PieChart();
        pieChart.setLabelsVisible(false);
        pieChart.setTitle(FormattingUtil.getFormatted("view.statistics.byproject"));
        statisticsView.getChildren().add(pieChart);

        // since getDisplayData only returns own data
        // we can safely assume the employee map only contains
        // one username
        Map.Entry<String, Map<String, AtomicLong>> projectToWorktime = statistics.getEmployeeToProjectToWorktime().entrySet().iterator().next();
        projectToWorktime.getValue().keySet().stream()
                .sorted(COLLATOR::compare)
                .forEach(project -> {
                    AtomicLong timespentForThisProject = projectToWorktime.getValue().get(project);
                    pieChart.getData().add(new PieChart.Data(project, timespentForThisProject.doubleValue()));
                });
    }
}
 
开发者ID:pbauerochse,项目名称:youtrack-worklog-viewer,代码行数:23,代码来源:OwnWorklogsTab.java

示例9: createChart

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
protected PieChart createChart() {
    final PieChart pc = new PieChart(FXCollections.observableArrayList(
        new PieChart.Data("Sun", 20),
        new PieChart.Data("IBM", 12),
        new PieChart.Data("HP", 25),
        new PieChart.Data("Dell", 22),
        new PieChart.Data("Apple", 30)
    ));
    // setup chart
    pc.setId("BasicPie");
    pc.setTitle("Pie Chart Example");
    return pc;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ChartAdvancedPie.java

示例10: start

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
@Override
public void start(Stage stage) throws Exception {
	ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList(
			new PieChart.Data("Education", 200),
			new PieChart.Data("Health", 130),
			new PieChart.Data("Defense", 200),
			new PieChart.Data("Agriculture", 200)
		
			);
	PieChart budget = new PieChart(pieChartData);
	budget.setTitle("Economy Divison");
	FlowPane root = new FlowPane();
	root.getChildren().add(budget);
	Scene scene =  new Scene(root,500,500);
	stage.setTitle("Pie Chart Demo");
	stage.setScene(scene);
	stage.show();
	
	
}
 
开发者ID:naeemkhan12,项目名称:JavaFx-Material-Design,代码行数:21,代码来源:Main.java

示例11: createObject

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
protected Object createObject(double width, double height) {
    ObservableList<Data> data = FXCollections.<Data>observableArrayList();
    for (int i = 0; i < 10; i++) {
        data.add(new Data("Data item " + i, i * 100));
    }
    PieChart chart = new PieChart(data);
    chart.setMaxSize(width, height);
    chart.setPrefSize(width, height);
    chart.setTitle("PieChart");
    chart.setStyle("-fx-border-color: darkgray;");
    return chart;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:13,代码来源:PieChartApp.java

示例12: getNewChart

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
public PieChart getNewChart() {
    data = FXCollections.<PieChart.Data>observableArrayList();
    for (int i = 0; i < 4; i++) {
        data.add(new PieChart.Data("Data item " + i, 50));
    }
    PieChart chart = new PieChart(data);
    chart.setTitle("PieChart");
    chart.setStyle("-fx-border-color: darkgray;");
    return chart;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:11,代码来源:PieChartManualApp.java

示例13: getNewChart

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
public PieChart getNewChart() {
    data = FXCollections.<Data>observableArrayList();
    //Don't change numbers here.
    for (int i = 0; i < 4; i++) {
        data.add(new Data("Data item " + i, 100));
    }
    PieChart chart = new PieChart(data);
    chart.setTitle("PieChart");
    chart.setStyle("-fx-border-color: darkgray;");
    return chart;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:12,代码来源:NewPieChartApp.java

示例14: criarGraficoPizza

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
private Node criarGraficoPizza() {
	PieChart graficoPizza = new PieChart();
	graficoPizza.getData().addAll(new PieChart.Data("Trimestre 1", 11),
			new PieChart.Data("Trimestre 2", 1),
			new PieChart.Data("Trimestre 3", 34),
			new PieChart.Data("Trimestre 5", 12));
	graficoPizza.setTitle("Lucros por Trimestre");
	graficoPizza.setPrefSize(GRAFICO_LARGURA, GRAFICO_ALTURA);
	return graficoPizza;
}
 
开发者ID:jesuino,项目名称:livro-javafx-pratico,代码行数:11,代码来源:Graficos.java

示例15: getPieChart

import javafx.scene.chart.PieChart; //导入方法依赖的package包/类
static PieChart getPieChart(String title) {

        PieChart pie = new PieChart();
        pie.setTitle(title);
        pie.setLegendVisible(false);
        pie.setBackground(Background.EMPTY);
        pie.setLegendVisible(true);
        pie.setLegendSide(Side.RIGHT);
        return pie;
    }
 
开发者ID:jtablesaw,项目名称:tablesaw,代码行数:11,代码来源:FxBuilder.java


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