use of javafx.scene.chart.CategoryAxis 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;
}
use of javafx.scene.chart.CategoryAxis 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;
}
use of javafx.scene.chart.CategoryAxis 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;
}
use of javafx.scene.chart.CategoryAxis in project Gargoyle by callakrsos.
the class GoogleTrendExam method start.
/* (non-Javadoc)
* @see javafx.application.Application#start(javafx.stage.Stage)
*/
@Override
public void start(Stage primaryStage) throws Exception {
URL url = new URL(createUrl());
String jsonString = RequestUtil.requestSSL(url, requestHandler);
// String source = ValueUtil.toString(GoogleTrendExam.class.getResourceAsStream("GoogleTrendSample.json"));
BaseGoogleTrendChart root = new BaseGoogleTrendChart(jsonString, new CategoryAxis(), new NumberAxis(0, 100, 10));
root.setVerticalGridLinesVisible(false);
root.addEventFilter(GoogleTrendChartEvent.GOOGLE_CHART_INTERSECT_NODE_CLICK, ev -> {
System.out.println(ev.getContents());
});
root.addEventHandler(GoogleTrendChartEvent.GOOGLE_CHART_INTERSECT_NODE_CLICK, ev -> {
System.out.println(ev.getContents());
});
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
use of javafx.scene.chart.CategoryAxis in project Gargoyle by callakrsos.
the class SVNViewer method initialize.
@FXML
public void initialize() {
tvSvnView = new SVNTreeView();
tvSvnView.setOnAction(this::svnTreeViewOnAction);
tvSvnView.setOnKeyPressed(this::svnTreeVoewOnKeyPressed);
tvSvnView.load();
anTreePane.getChildren().set(0, tvSvnView);
AnchorPane.setLeftAnchor(tvSvnView, 0.0);
AnchorPane.setRightAnchor(tvSvnView, 0.0);
AnchorPane.setBottomAnchor(tvSvnView, 0.0);
AnchorPane.setTopAnchor(tvSvnView, 0.0);
colRevision.setCellValueFactory(v -> new SimpleObjectProperty<Long>(v.getValue().getRevision()));
colUser.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getAuthor()));
colComment.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getMessage()));
colDate.setCellValueFactory(v -> new SimpleStringProperty(DateUtil.getDateString(v.getValue().getDate().getTime(), "yyyy-MM-dd")));
javaTextAre = new JavaTextArea();
borSource.setCenter(javaTextAre);
lineHist = new LineChart<>(new CategoryAxis(), new CategoryAxis());
borChart.setCenter(lineHist);
tbRevision.getSelectionModel().setCellSelectionEnabled(true);
tbRevision.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
// FxClipboardUtil.installCopyPasteHandler(tbRevision);
// FxTableViewUtil.
FxUtil.installClipboardKeyEvent(tbRevision);
MenuItem menuDiff = new MenuItem("Diff");
menuDiff.setOnAction(this::menuDiffOnAction);
tbRevision.setContextMenu(new ContextMenu(menuDiff));
tvSvnView.svnGraphPropertyProperty().addListener((oba, oldView, newView) -> {
if (newView != null) {
Tab tabSvnGraph = new Tab("SVN Graph", newView);
if (tabPaneSVN.getTabs().size() <= TAB_INDEX_SVN_GRAPH) {
tabPaneSVN.getTabs().add(tabSvnGraph);
} else {
tabPaneSVN.getTabs().add(TAB_INDEX_SVN_GRAPH, tabSvnGraph);
}
}
});
displayLatestRevision();
}
Aggregations