Search in sources :

Example 1 with StackedBarChart

use of javafx.scene.chart.StackedBarChart in project Board-Instrumentation-Framework by intel.

the class StackedBarChartWidget method CreateChartObject.

@Override
protected Chart CreateChartObject() {
    ArrayList<String> list = new ArrayList<>();
    for (String key : _SeriesOrder) {
        if (null == _SeriesMap.get(key)) {
            LOGGER.severe("Unexpected probelm in CreateChartObject");
            break;
        }
        ArrayList<SeriesDataSet> setList = _SeriesMap.get(key).getSeriesList();
        if (null == setList) {
            LOGGER.severe("Unexpected probelm in CreateChartObject");
            break;
        }
        for (SeriesDataSet set : setList) {
            list.add(set.getTitle());
        }
        break;
    }
    getAxis_X().setCategories(FXCollections.observableArrayList(list));
    return new StackedBarChart<String, Number>(getAxis_X(), getyAxis());
}
Also used : ArrayList(java.util.ArrayList) StackedBarChart(javafx.scene.chart.StackedBarChart) SeriesDataSet(kutch.biff.marvin.utility.SeriesDataSet)

Example 2 with StackedBarChart

use of javafx.scene.chart.StackedBarChart in project jvarkit by lindenb.

the class AlleleFrequencyChartFactory method build.

@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;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) CategoryAxis(javafx.scene.chart.CategoryAxis) StackedBarChart(javafx.scene.chart.StackedBarChart) XYChart(javafx.scene.chart.XYChart)

Example 3 with StackedBarChart

use of javafx.scene.chart.StackedBarChart in project jvarkit by lindenb.

the class TiTvChartFactory 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>> 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;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) ArrayList(java.util.ArrayList) StackedBarChart(javafx.scene.chart.StackedBarChart) CategoryAxis(javafx.scene.chart.CategoryAxis) XYChart(javafx.scene.chart.XYChart)

Example 4 with StackedBarChart

use of javafx.scene.chart.StackedBarChart 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;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) ArrayList(java.util.ArrayList) StackedBarChart(javafx.scene.chart.StackedBarChart) CategoryAxis(javafx.scene.chart.CategoryAxis) XYChart(javafx.scene.chart.XYChart)

Example 5 with StackedBarChart

use of javafx.scene.chart.StackedBarChart 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;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) ArrayList(java.util.ArrayList) StackedBarChart(javafx.scene.chart.StackedBarChart) CigarOperator(htsjdk.samtools.CigarOperator) CategoryAxis(javafx.scene.chart.CategoryAxis) XYChart(javafx.scene.chart.XYChart)

Aggregations

StackedBarChart (javafx.scene.chart.StackedBarChart)8 CategoryAxis (javafx.scene.chart.CategoryAxis)7 NumberAxis (javafx.scene.chart.NumberAxis)7 XYChart (javafx.scene.chart.XYChart)7 ArrayList (java.util.ArrayList)5 TreeSet (java.util.TreeSet)2 CigarOperator (htsjdk.samtools.CigarOperator)1 GenotypeType (htsjdk.variant.variantcontext.GenotypeType)1 SeriesDataSet (kutch.biff.marvin.utility.SeriesDataSet)1