當前位置: 首頁>>代碼示例>>Java>>正文


Java BarChart.setCategoryGap方法代碼示例

本文整理匯總了Java中javafx.scene.chart.BarChart.setCategoryGap方法的典型用法代碼示例。如果您正苦於以下問題:Java BarChart.setCategoryGap方法的具體用法?Java BarChart.setCategoryGap怎麽用?Java BarChart.setCategoryGap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.chart.BarChart的用法示例。


在下文中一共展示了BarChart.setCategoryGap方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createChart

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
protected BarChart<String, Number> createChart() {
    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis(0,50,10);
    final BarChart<String,Number> bc = new BarChart<String,Number>(xAxis,yAxis);
    bc.setId("barAudioDemo");
    bc.setLegendVisible(false);
    bc.setAnimated(false);
    bc.setBarGap(0);
    bc.setCategoryGap(1);
    bc.setVerticalGridLinesVisible(false);
    // setup chart
    bc.setTitle("Live Audio Spectrum Data");
    xAxis.setLabel("Frequency Bands");
    yAxis.setLabel("Magnitudes");
    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis,null,"dB"));
    // add starting data
    XYChart.Series<String,Number> series1 = new XYChart.Series<String,Number>();
    series1.setName("Data Series 1");
    //noinspection unchecked
    series1Data = new XYChart.Data[128];
    String[] categories = new String[128];
    for (int i=0; i<series1Data.length; i++) {
        categories[i] = Integer.toString(i+1);
        series1Data[i] = new XYChart.Data<String,Number>(categories[i],50);
        series1.getData().add(series1Data[i]);
    }
    bc.getData().add(series1);
    return bc;
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:30,代碼來源:AdvBarAudioChartSample.java

示例2: getBarChart

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
static BarChart<String, Number> getBarChart(String title, CategoryAxis categoryAxis, NumberAxis numberAxis) {

        BarChart<String, Number> bar = new BarChart<>(categoryAxis, numberAxis);
        bar.setTitle(title);
        bar.setLegendVisible(false);
        bar.setCategoryGap(0.0);
        bar.setBarGap(0.1);
        bar.setBackground(Background.EMPTY);
        bar.setVerticalGridLinesVisible(false);
        return bar;
    }
 
開發者ID:jtablesaw,項目名稱:tablesaw,代碼行數:12,代碼來源:FxBuilder.java

示例3: getNumberStringBarChart

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
private static BarChart<Number, String> getNumberStringBarChart(String title, NumberAxis xAxis, CategoryAxis
        yAxis) {
    final BarChart<Number, String> bar = new BarChart<>(xAxis, yAxis);
    bar.setTitle(title);
    bar.setLegendVisible(false);
    bar.setCategoryGap(0.0);
    bar.setBarGap(0.25);
    bar.setBackground(Background.EMPTY);
    bar.setHorizontalGridLinesVisible(false);
    return bar;
}
 
開發者ID:jtablesaw,項目名稱:tablesaw,代碼行數:12,代碼來源:FxHorizontalBar.java

示例4: chart

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
public static BarChart<String, Number> chart(
        String title,
        CategoryColumn x,
        NumericColumn y) {

    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis();
    xAxis.setLabel(x.name());
    yAxis.setLabel(y.name());

    Table t = Table.create("", x, y);
    t = t.sortDescendingOn(y.name());

    final BarChart<String, Number> bar = new BarChart<>(xAxis, yAxis);

    bar.setTitle(title);

    List<XYChart.Data<String, Number>> d2 = new ArrayList<>(x.size());

    for (int i = 0; i < x.size(); i++) {
        d2.add(new XYChart.Data<>(t.categoryColumn(0).get(i), t.nCol(1).getFloat(i)));
    }
    XYChart.Series<String, Number> series1
            = new XYChart.Series<>(FXCollections.observableList(d2));

    series1.setName(y.name());

    bar.setLegendVisible(false);
    bar.setCategoryGap(0.0);
    bar.setBarGap(0.1);
    bar.setBackground(Background.EMPTY);
    bar.setVerticalGridLinesVisible(false);

    bar.getData().add(series1);
    return bar;
}
 
開發者ID:jtablesaw,項目名稱:tablesaw,代碼行數:37,代碼來源:FxPareto.java

示例5: initializeRankDistributionChart

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
public final void initializeRankDistributionChart(){
    xAxis = new CategoryAxis();
    yAxis = new NumberAxis();
    xAxis.setLabel("Rank");
    xAxis.setTickLength(5);
    yAxis.setTickLabelsVisible(false);
    yAxis.setTickMarkVisible(false);
    rankDistributionChart = new BarChart(xAxis,yAxis);
    rankDistributionChart.setLegendVisible(false);
    UIUtils.setSize(rankDistributionChart, Main.columnWidthRIGHT+5, 300);
    rankDistributionChart.setCategoryGap(0);
}
 
開發者ID:AdrienGuille,項目名稱:SONDY,代碼行數:13,代碼來源:InfluenceAnalysisUI.java

示例6: build

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
@Override
public Chart build() {	        
   	final CategoryAxis xAxis = new CategoryAxis();
   	xAxis.setLabel("Sex");
       final NumberAxis yAxis = new NumberAxis();
       yAxis.setLabel("Mean-MAF");

   	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
   	serie.setName("Sex");

       for(int i=0;i< this.popcount.size();++i) {
       	final PedFile.Sex sexxxxx = PedFile.Sex.values()[i];
       	double v=0;
       	if(this.popcount.get(i).num_maf>0)
       		{
       		v=this.popcount.get(i).sum/((double)this.popcount.get(i).num_maf);
       		}
       	serie.getData().add(new XYChart.Data<String,Number>(
       			sexxxxx.name(),v)
       			);
        	
        }
       
       final BarChart<String, Number> sbc =
               new BarChart<String, Number>(xAxis, yAxis);
       sbc.setTitle(this.getName());
       sbc.getData().add(serie);
       sbc.setCategoryGap(0.2);
       sbc.setLegendVisible(false);
       return sbc;
       }
 
開發者ID:lindenb,項目名稱:jvarkit,代碼行數:32,代碼來源:AFBySexChartFactory.java

示例7: build

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
@Override
public Chart build() {	        
   	final CategoryAxis xAxis = new CategoryAxis();
   	xAxis.setLabel("DP");
       final NumberAxis yAxis = new NumberAxis();
       yAxis.setLabel("Count");

       
   	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
   	serie.setName(xAxis.getLabel());
   	
   	for(Integer dp: new TreeSet<>(this.afindexcount.keySet()))
       	{
       	serie.getData().add(new XYChart.Data<String,Number>(
       			String.valueOf(dp),
       			this.afindexcount.count(dp))
       			);
       	}
   	
       final BarChart<String, Number> sbc =
               new BarChart<String, Number>(xAxis, yAxis);
       sbc.setTitle(this.getName());
       sbc.getData().add(serie);
       sbc.setCategoryGap(0.2);
       sbc.setLegendVisible(false);
       return sbc;
       }
 
開發者ID:lindenb,項目名稱:jvarkit,代碼行數:28,代碼來源:VariantDepthChartFactory.java

示例8: build

import javafx.scene.chart.BarChart; //導入方法依賴的package包/類
@Override
public Chart build() {	        
   	final CategoryAxis xAxis = new CategoryAxis();
   	xAxis.setLabel("Population");
       final NumberAxis yAxis = new NumberAxis();
       yAxis.setLabel("Mean-MAF");

   	final XYChart.Series<String, Number> serie= new XYChart.Series<String, Number>();
   	serie.setName("Population");

       for(int i=0;i< this.popcount.size();++i) {
       	final PedFile.Status status = PedFile.Status.values()[i];
       	double v=0;
       	if(this.popcount.get(i).num_maf>0)
       		{
       		v=this.popcount.get(i).sum/((double)this.popcount.get(i).num_maf);
       		}
       	serie.getData().add(new XYChart.Data<String,Number>(
       			status.name(),v)
       			);
        	
        }
       
       final BarChart<String, Number> sbc =
               new BarChart<String, Number>(xAxis, yAxis);
       sbc.setTitle(this.getName());
       sbc.getData().add(serie);
       sbc.setCategoryGap(0.2);
       sbc.setLegendVisible(false);
       return sbc;
       }
 
開發者ID:lindenb,項目名稱:jvarkit,代碼行數:32,代碼來源:AFByPopulationChartFactory.java


注:本文中的javafx.scene.chart.BarChart.setCategoryGap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。