use of javafx.scene.chart.BarChart in project Gargoyle by callakrsos.
the class ScmCommitComposite method load.
public void load() {
try {
scmHistoryWalk();
getBarChartDayOfMonthCategory().setLabel("기간별 커밋 통계");
getLineChartDayOfWeekCategory().setLabel("요일별 커밋 통계");
getBarChartDayOfMonthCategory().getCategories().add(SERIES_LABEL);
getLineChartDayOfWeekCategory().getCategories().add(SERIES_LABEL);
Color lineColor = Color.GREEN;
double strokeWidth = 1;
String cssStyleClassName = ".chart-series-line";
{
/*start Desing css.*/
BarChart<String, Long> barChartDayOfMonth = getBarChartDayOfMonth();
String style = "-fx-bar-fill: ".concat(FxUtil.toWebString(lineColor)).concat(";");
for (Node n : barChartDayOfMonth.lookupAll(".default-color0.chart-bar")) {
n.setStyle(style);
}
// barChartDayOfMonth.setStyle(
// ".chart-legend-item-syCmbol chart-bar series0 bar-legend-symbol default-color0{- fx-background-color:green;}");
/*end Desing css.*/
/*start Popover*/
//무조건 1개의 시리즈만 처리하므로 인덱스에서 바로 가져옴.
ObservableList<Data<String, Long>> dataArr = getBarChartDayOfMonth().getData().get(0).getData();
for (Data<String, Long> d : dataArr) {
d.getNode().setOnMouseClicked(ev -> {
if (ev.getClickCount() == 1 && ev.getButton() == MouseButton.PRIMARY)
createPopOver(d);
});
}
barChartDayOfMonth.setMinWidth(BarChart.USE_COMPUTED_SIZE);
barChartDayOfMonth.requestLayout();
/*end Popover*/
}
{
LineChart<String, Long> lineChartDayOfWeek = getLineChartDayOfWeek();
lineChartDayOfWeek.setStyle(".chart-series-line .series0 .default-color0{- fx-background-color:green;}");
Set<Node> lookupAll = lineChartDayOfWeek.lookupAll(".chart-line-symbol");
StringBuffer sb = new StringBuffer();
sb.append("-fx-background-color: " + FxUtil.toRgbString(lineColor) + ", white;");
sb.append(" -fx-background-insets: 0, 2;");
sb.append("-fx-background-radius: 5px;");
sb.append("-fx-padding: 5px;");
for (Node n : lookupAll) {
n.setStyle(sb.toString());
}
String style = "-fx-stroke: " + FxUtil.toRgbString(lineColor) + "; -fx-stroke-width: " + strokeWidth + ";";
for (Node seriesLine : lineChartDayOfWeek.lookupAll(cssStyleClassName)) {
seriesLine.setStyle(style);
}
}
} catch (SVNException e) {
LOGGER.error(ValueUtil.toString(e));
}
}
use of javafx.scene.chart.BarChart in project Gargoyle by callakrsos.
the class PMDViolationbyBarChartComposite method createNode.
/* (non-Javadoc)
* @see com.kyj.fx.voeditor.visual.component.pmd.chart.PMDViolationChartVisualable#createNode()
*/
@Override
public Node createNode() {
xAxis = new CategoryAxis();
xAxis.setAutoRanging(false);
xAxis.setAnimated(false);
yAxis = new NumberAxis();
yAxis.setAnimated(false);
yAxis.setPrefWidth(60d);
yAxis.setAutoRanging(true);
yAxis.setMaxWidth(60d);
yAxis.setLabel("Violation Count");
Series<String, Number> dataList = new Series<>(FXCollections.observableArrayList());
dataList.setName("Priority");
BarChart<String, Number> c = new BarChart<>(xAxis, yAxis);
barChart.set(c);
series = c.getData();
series.add(0, dataList);
this.dataList = dataList.getData();
return c;
}
use of javafx.scene.chart.BarChart in project jvarkit by lindenb.
the class VariantDepthChartFactory method build.
@Override
public Chart build() {
final CategoryAxis xAxis = new CategoryAxis();
xAxis.setLabel("DP");
final NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("Count");
final XYChart.Series<String, Number> serie = new XYChart.Series<String, Number>();
serie.setName(xAxis.getLabel());
for (Integer dp : new TreeSet<>(this.afindexcount.keySet())) {
serie.getData().add(new XYChart.Data<String, Number>(String.valueOf(dp), this.afindexcount.count(dp)));
}
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.BarChart 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;
}
use of javafx.scene.chart.BarChart 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;
}
Aggregations