use of javafx.scene.chart.StackedBarChart 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.StackedBarChart 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;
}
use of javafx.scene.chart.StackedBarChart in project jvarkit by lindenb.
the class SamFlagsChartFactory method build.
@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;
}
Aggregations