Search in sources :

Example 11 with CategoryAxis

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

Example 12 with CategoryAxis

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;
}
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 13 with CategoryAxis

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;
}
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)

Example 14 with CategoryAxis

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

Example 15 with CategoryAxis

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

Aggregations

CategoryAxis (javafx.scene.chart.CategoryAxis)17 NumberAxis (javafx.scene.chart.NumberAxis)15 XYChart (javafx.scene.chart.XYChart)11 StackedBarChart (javafx.scene.chart.StackedBarChart)7 BarChart (javafx.scene.chart.BarChart)6 ArrayList (java.util.ArrayList)5 TreeSet (java.util.TreeSet)3 PedFile (com.github.lindenb.jvarkit.tools.vcfviewgui.PedFile)2 Series (javafx.scene.chart.XYChart.Series)2 GraphDataBean (com.canoo.dp.impl.platform.projector.graph.GraphDataBean)1 GraphMetadata (com.canoo.dp.impl.platform.projector.graph.GraphMetadata)1 GraphType (com.canoo.dp.impl.platform.projector.graph.GraphType)1 MetadataUtilities (com.canoo.dp.impl.platform.projector.metadata.MetadataUtilities)1 Binding (com.canoo.platform.core.functional.Binding)1 Subscription (com.canoo.platform.core.functional.Subscription)1 FXBinder (com.canoo.platform.remoting.client.javafx.FXBinder)1 BaseGoogleTrendChart (com.kyj.fx.voeditor.visual.component.chart.service.BaseGoogleTrendChart)1 JavaTextArea (com.kyj.fx.voeditor.visual.component.text.JavaTextArea)1 Location (eu.hansolo.tilesfx.tools.Location)1 TimeData (eu.hansolo.tilesfx.tools.TimeData)1