use of org.jfree.chart.renderer.xy.StackedXYBarRenderer in project hmftools by hartwigmedical.
the class CopyNumberCharts method somaticPloidyPDF.
@NotNull
static JFreeChart somaticPloidyPDF(@NotNull final List<PurityAdjustedSomaticVariant> variants) {
final CategoryTableXYDataset dataset = variants(variants);
final JFreeChart chart = ChartFactory.createXYBarChart("Somatic Variant Ploidy PDF", "Ploidy", false, "Count", dataset, PlotOrientation.VERTICAL, true, false, false);
StackedXYBarRenderer renderer = new StackedXYBarRenderer();
renderer.setBarPainter(new StandardXYBarPainter());
renderer.setShadowVisible(false);
XYPlot xyPlot = (XYPlot) chart.getPlot();
xyPlot.setRenderer(renderer);
for (int i = 0; i < dataset.getSeriesCount(); i++) {
renderer.setSeriesPaint(i, copyNumberColor(String.valueOf(dataset.getSeriesKey(i))));
}
return chart;
}
use of org.jfree.chart.renderer.xy.StackedXYBarRenderer in project hmftools by hartwigmedical.
the class CopyNumberCharts method minorAllelePDF.
@NotNull
static JFreeChart minorAllelePDF(@NotNull final List<PurpleCopyNumber> variants) {
final CategoryTableXYDataset dataset = minorAllele(variants);
final JFreeChart chart = ChartFactory.createXYBarChart("Minor Allele Ploidy PDF", "Ploidy", false, "BAF Count", dataset, PlotOrientation.VERTICAL, true, false, false);
StackedXYBarRenderer renderer = new StackedXYBarRenderer();
renderer.setBarPainter(new StandardXYBarPainter());
renderer.setShadowVisible(false);
XYPlot xyPlot = (XYPlot) chart.getPlot();
xyPlot.setRenderer(renderer);
xyPlot.getDomainAxis().setRange(-1.1, 5.1);
for (int i = 0; i < dataset.getSeriesCount(); i++) {
renderer.setSeriesPaint(i, copyNumberColor(String.valueOf(dataset.getSeriesKey(i))));
}
return chart;
}
Aggregations