use of javafx.scene.chart.CategoryAxis in project jOOQ by jOOQ.
the class BarChartSample method chart.
private BarChart<String, Number> chart(TableField<CountriesRecord, ? extends Number> field, String title, String yAxisLabel) {
CategoryAxis xAxis = new CategoryAxis();
NumberAxis yAxis = new NumberAxis();
xAxis.setLabel("Country");
yAxis.setLabel(yAxisLabel);
BarChart<String, Number> bc = new BarChart<>(xAxis, yAxis);
bc.setTitle(title);
bc.setUserData(field);
return bc;
}
use of javafx.scene.chart.CategoryAxis in project jvarkit by lindenb.
the class BasesPerPositionChartFactory method build.
@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;
}
use of javafx.scene.chart.CategoryAxis in project jvarkit by lindenb.
the class CigarOpPerPositionChartFactory method build.
@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;
}
use of javafx.scene.chart.CategoryAxis in project jvarkit by lindenb.
the class GenotypeTypeChartFactory method build.
@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;
}
use of javafx.scene.chart.CategoryAxis in project jvarkit by lindenb.
the class ReadLengthChartFactory method build.
@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;
}
Aggregations