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


Java StackedBarChart类代码示例

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


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

示例1: GraphView

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
public GraphView(GraphModel model, Stage primaryStage) {

		Stage stage = new Stage();
		stage.initModality(Modality.NONE);
		stage.initOwner(primaryStage);

		stage.setTitle(model.getStageTitle());
		CategoryAxis xAxis = model.getXAxis();
		NumberAxis yAxis = model.getYAxis();
		StackedBarChart<String, Number> bc = new StackedBarChart<String, Number>(
				xAxis, yAxis);
		bc.setTitle(model.getBarTitle());

		Scene scene = new Scene(bc, 800, 600);
		bc.getData().addAll(model.getSeries());
		stage.setScene(scene);
		stage.show();
	}
 
开发者ID:talpalaru,项目名称:polTool,代码行数:19,代码来源:GraphView.java

示例2: stackedGraphExample

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
public void stackedGraphExample(Stage stage) {
    stage.setTitle("Stacked Bar Chart");
    final StackedBarChart<String, Number> stackedBarChart
            = new StackedBarChart<>(xAxis, yAxis);
    stackedBarChart.setTitle("Country Population");
    xAxis.setLabel("Country");
    xAxis.setCategories(FXCollections.<String>observableArrayList(
            Arrays.asList(belgium, germany, france,
                    netherlands, sweden, unitedKingdom)));
    yAxis.setLabel("Population");

    series1.setName("1950");
    addDataItem(series1, belgium, 8639369);
    addDataItem(series1, france, 42518000);
    addDataItem(series1, germany, 68374572);
    addDataItem(series1, netherlands, 10113527);
    addDataItem(series1, sweden, 7014005);
    addDataItem(series1, unitedKingdom, 50127000);

    series2.setName("1960");
    addDataItem(series2, belgium, 9118700);
    addDataItem(series2, france, 46584000);
    addDataItem(series2, germany, 72480869);
    addDataItem(series2, netherlands, 11486000);
    addDataItem(series2, sweden, 7480395);
    addDataItem(series2, unitedKingdom, 52372000);

    series3.setName("1970");
    addDataItem(series3, belgium, 9637800);
    addDataItem(series3, france, 51918000);
    addDataItem(series3, germany, 77783164);
    addDataItem(series3, netherlands, 13032335);
    addDataItem(series3, sweden, 8042803);
    addDataItem(series3, unitedKingdom, 55632000);

    Scene scene = new Scene(stackedBarChart, 800, 600);
    stackedBarChart.getData().addAll(series1, series2, series3);
    stage.setScene(scene);
    stage.show();
}
 
开发者ID:PacktPublishing,项目名称:Machine-Learning-End-to-Endguide-for-Java-developers,代码行数:41,代码来源:BarCharts - MainApp.java

示例3: createObject

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

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

示例4: getNewChartInstance

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
protected Chart getNewChartInstance() {
    ObservableList<String> existingCategories = FXCollections.observableArrayList();
    existingCategories.addAll("category1", "category2", "category3");
    CategoryAxis axis1 = new CategoryAxis(existingCategories);
    NumberAxis axis2 = new NumberAxis(0, 100, 10);
    StackedBarChart chart = new StackedBarChart(axis2, axis1);
    return chart;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:10,代码来源:StackedBarChartTest.java

示例5: testGetStackedBarChartAdjuster

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Test
public void testGetStackedBarChartAdjuster() {
	Adjuster adjuster = Adjuster.getAdjuster(StackedBarChart.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.StackedBarChart; //导入依赖的package包/类
@Override
protected XYChart<String, Number> createXYChart() {
    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis();
    final XYChart<String, Number> chart = new StackedBarChart<String, Number>(xAxis, yAxis);
    chart.getStyleClass().add("chart-extension");
    return chart;
}
 
开发者ID:asciidocfx,项目名称:AsciidocFX,代码行数:9,代码来源:StackedBarChartBuilderService.java

示例7: build

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
public Chart build() {	        
   	final CategoryAxis xAxis = new CategoryAxis();
   	xAxis.setLabel("AF");
       final NumberAxis yAxis = new NumberAxis();
       yAxis.setLabel("Count");

       
   	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
   	serie.setName(xAxis.getLabel());
   	
   	
       for(final Limit limit  :this.limits)
       	{
       	if(this.afindexcount.count(limit.index)==0L) continue;
       	serie.getData().add(new XYChart.Data<String,Number>(
       			limit.label,
       			this.afindexcount.count(limit.index))
       			);
       	}
       
       final StackedBarChart<String, Number> sbc =
               new StackedBarChart<String, Number>(xAxis, yAxis);
       sbc.setTitle("Allele Frequency"+(this.nSamples>0?" (Nbr. Sample(s):"+this.nSamples+")":""));
       sbc.getData().add(serie);
       sbc.setCategoryGap(0.2);
       sbc.setLegendVisible(false);
       return sbc;
       }
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:30,代码来源:AlleleFrequencyChartFactory.java

示例8: build

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
public Chart build() {	        
   	final CategoryAxis xAxis = new CategoryAxis();
   	xAxis.setLabel("Sample");
       final NumberAxis yAxis = new NumberAxis();
       yAxis.setLabel("Count");

       final List<XYChart.Series<String, Number>> type2count =new ArrayList<>(3);
       for(int i=0;i<2;++i) {
       	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
       	serie.setName(i==0?"Transition":"Transversion");
       	type2count.add(serie);
       	
       	if( this.sample2titv.isEmpty())
        	{
        	serie.getData().add(new XYChart.Data<String,Number>(
        			"ALL",
        			(i==0?all.transition:all.transvertion)
        			));
        	}
       	else
        	{
	        for(final String sampleName : this.sample2titv.keySet())
	        	{
	        	final TiTv titv= this.sample2titv.get(sampleName);
	        	serie.getData().add(new XYChart.Data<String,Number>(
	        			sampleName,
	        			(i==0?titv.transition:titv.transvertion)
	        			));
	        	}
	        }
       	}
       final StackedBarChart<String, Number> sbc =
               new StackedBarChart<String, Number>(xAxis, yAxis);
       sbc.setTitle(this.getName());
       sbc.getData().addAll(type2count);
       sbc.setCategoryGap(0.2);
       return sbc;
       }
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:40,代码来源:TiTvChartFactory.java

示例9: build

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
public Chart build() {	        
   	final CategoryAxis xAxis = new CategoryAxis();
   	xAxis.setLabel("Sample");
       final NumberAxis yAxis = new NumberAxis();
       yAxis.setLabel("Count");

       final List<XYChart.Series<String, Number>> gtype2count=new ArrayList<>(GenotypeType.values().length);
       for(final GenotypeType genotypeType :GenotypeType.values()) {
       	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
       	serie.setName(genotypeType.name());
       	gtype2count.add(serie);
       	
        for(final String sampleName : this.sample2count.keySet())
        	{
        	serie.getData().add(new XYChart.Data<String,Number>(
        			sampleName,
        			this.sample2count.get(sampleName).count(genotypeType))
        			);
        	}
        }
       
       final StackedBarChart<String, Number> sbc =
               new StackedBarChart<String, Number>(xAxis, yAxis);
       sbc.setTitle(this.getName());
       sbc.getData().addAll(gtype2count);
       sbc.setCategoryGap(0.2);
       return sbc;
       }
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:30,代码来源:GenotypeTypeChartFactory.java

示例10: build

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
public StackedBarChart<String, Number> build()
    {	        
	final CategoryAxis xAxis = new CategoryAxis();
	xAxis.setLabel("Flags");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");

    
	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
	serie.setName("Flags");
	
	
    for(final Integer L  : new TreeSet<Integer>(this.flags2count.keySet()))
    	{
    	serie.getData().add(new XYChart.Data<String,Number>(
    			String.valueOf(L),
    			this.flags2count.count(L))
    			);
    	}
    
    final StackedBarChart<String, Number> sbc =
            new StackedBarChart<String, Number>(xAxis, yAxis);
    sbc.setTitle("SAM Flags");
    sbc.getData().add(serie);
    sbc.setCategoryGap(0.2);
    sbc.setLegendVisible(false);
    return sbc;
    }
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:30,代码来源:SamFlagsChartFactory.java

示例11: build

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
public StackedBarChart<String, Number> build()
    {	        
	final CategoryAxis xAxis = new CategoryAxis();
	xAxis.setLabel("Length");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");

    
	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
	serie.setName("Length");
	
	
    for(final Integer L  : new TreeSet<Integer>(this.length2count.keySet()))
    	{
    	serie.getData().add(new XYChart.Data<String,Number>(
    			String.valueOf(L),
    			this.length2count.count(L))
    			);
    	}
    
    final StackedBarChart<String, Number> sbc =
            new StackedBarChart<String, Number>(xAxis, yAxis);
    sbc.setTitle("Reads Lengths");
    sbc.getData().add(serie);
    sbc.setCategoryGap(0.2);
    sbc.setLegendVisible(false);
    return sbc;
    }
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:30,代码来源:ReadLengthChartFactory.java

示例12: build

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
public StackedBarChart<String, Number> build()
    {        
	final CategoryAxis xAxis = new CategoryAxis();
	xAxis.setLabel("Position in Read");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");

    
    final List<XYChart.Series<String, Number>> base2count=new ArrayList<>();
    for(final CigarOperator cigarop:CigarOperator.values())
    	{
    	if(cigarop==CigarOperator.P) continue;
    	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
    	serie.setName(cigarop.name());
    	base2count.add(serie);
    	
     for(int i=0;i<  this.cigar2pos2count.size();++i)
     	{
     	serie.getData().add(new XYChart.Data<String,Number>(
     			String.valueOf(i+1),
     			this.cigar2pos2count.get(i).count(cigarop))
     			);
     	}
     }
    
    final StackedBarChart<String, Number> sbc =
            new StackedBarChart<String, Number>(xAxis, yAxis);
    sbc.setTitle(getName());
    sbc.getData().addAll(base2count);
    sbc.setCategoryGap(0.2);
    
    return sbc;
    }
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:35,代码来源:CigarOpPerPositionChartFactory.java

示例13: build

import javafx.scene.chart.StackedBarChart; //导入依赖的package包/类
@Override
public StackedBarChart<String, Number> build()
    {        
	final CategoryAxis xAxis = new CategoryAxis();
	xAxis.setLabel("Position in Read");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");

    
    final List<XYChart.Series<String, Number>> base2count=new ArrayList<>(all_chars.size());
    for(final Character base:all_chars) {
    	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
    	serie.setName(base.toString());
    	base2count.add(serie);
    	
     for(int i=0;i<  this.pos2base2count.size();++i)
     	{
     	serie.getData().add(new XYChart.Data<String,Number>(
     			String.valueOf(i+1),
     			this.pos2base2count.get(i).count(base))
     			);
     	}
     }
    
    final StackedBarChart<String, Number> sbc =
            new StackedBarChart<String, Number>(xAxis, yAxis);
    sbc.setTitle("Position/Base/Count");
    sbc.getData().addAll(base2count);
    sbc.setCategoryGap(0.2);
    
    return sbc;
    }
 
开发者ID:lindenb,项目名称:jvarkit,代码行数:33,代码来源:BasesPerPositionChartFactory.java

示例14: getNewChart

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


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