Search in sources :

Example 6 with NumberAxis

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

the class VariantQualChartFactory method build.

@Override
public Chart build() {
    final NumberAxis xAxis = new NumberAxis();
    xAxis.setLabel("QUAL");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");
    final XYChart.Series<Number, Number> serie = new XYChart.Series<Number, Number>();
    serie.setName(xAxis.getLabel());
    for (final Integer i : new TreeSet<>(this.qual2count.keySet())) {
        serie.getData().add(new XYChart.Data<Number, Number>(i, this.qual2count.count(i)));
    }
    final LineChart<Number, Number> sbc = new LineChart<Number, Number>(xAxis, yAxis);
    sbc.setTitle(this.getName());
    sbc.getData().add(serie);
    sbc.setCreateSymbols(false);
    sbc.setLegendVisible(false);
    return sbc;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) TreeSet(java.util.TreeSet) XYChart(javafx.scene.chart.XYChart) LineChart(javafx.scene.chart.LineChart)

Example 7 with NumberAxis

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

the class AFByPopulationChartFactory method build.

@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;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) PedFile(com.github.lindenb.jvarkit.tools.vcfviewgui.PedFile) CategoryAxis(javafx.scene.chart.CategoryAxis) BarChart(javafx.scene.chart.BarChart) XYChart(javafx.scene.chart.XYChart)

Example 8 with NumberAxis

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

the class AFBySexChartFactory method build.

@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;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) PedFile(com.github.lindenb.jvarkit.tools.vcfviewgui.PedFile) CategoryAxis(javafx.scene.chart.CategoryAxis) BarChart(javafx.scene.chart.BarChart) XYChart(javafx.scene.chart.XYChart)

Example 9 with NumberAxis

use of javafx.scene.chart.NumberAxis 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 10 with NumberAxis

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

the class GCPercentChartFactory method build.

@Override
public LineChart<Number, Number> build() {
    final NumberAxis xAxis = new NumberAxis();
    xAxis.setLabel("%GC");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");
    final XYChart.Series<Number, Number> serie = new XYChart.Series<Number, Number>();
    serie.setName("QC");
    for (int g = 0; g <= 100; ++g) {
        serie.getData().add(new XYChart.Data<Number, Number>(g, this.gcPercent2count.count(g)));
    }
    final LineChart<Number, Number> sbc = new LineChart<Number, Number>(xAxis, yAxis);
    sbc.setTitle("Percentage GC");
    sbc.getData().add(serie);
    sbc.setCreateSymbols(false);
    sbc.setLegendVisible(false);
    return sbc;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) XYChart(javafx.scene.chart.XYChart) LineChart(javafx.scene.chart.LineChart)

Aggregations

NumberAxis (javafx.scene.chart.NumberAxis)32 XYChart (javafx.scene.chart.XYChart)25 CategoryAxis (javafx.scene.chart.CategoryAxis)15 StackedBarChart (javafx.scene.chart.StackedBarChart)7 BarChart (javafx.scene.chart.BarChart)6 LineChart (javafx.scene.chart.LineChart)6 ArrayList (java.util.ArrayList)5 TreeSet (java.util.TreeSet)4 Node (javafx.scene.Node)4 Path (javafx.scene.shape.Path)3 CandleData (bisq.desktop.main.market.trades.charts.CandleData)2 PedFile (com.github.lindenb.jvarkit.tools.vcfviewgui.PedFile)2 CandleData (io.bitsquare.gui.main.market.trades.charts.CandleData)2 Insets (javafx.geometry.Insets)2 Scene (javafx.scene.Scene)2 StackPane (javafx.scene.layout.StackPane)2 StringConverter (javafx.util.StringConverter)2 CandleStickChart (bisq.desktop.main.market.trades.charts.price.CandleStickChart)1 VolumeChart (bisq.desktop.main.market.trades.charts.volume.VolumeChart)1 GraphDataBean (com.canoo.dp.impl.platform.projector.graph.GraphDataBean)1