use of javafx.scene.chart.LineChart in project jvarkit by lindenb.
the class ReadQualityChartFactory method build.
@Override
public LineChart<Number, Number> build() {
final NumberAxis xAxis = new NumberAxis();
xAxis.setLabel("Quality");
final NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("Count");
final XYChart.Series<Number, Number> serie = new XYChart.Series<Number, Number>();
serie.setName(xAxis.getLabel());
for (int g = 0; g <= 100; ++g) {
serie.getData().add(new XYChart.Data<Number, Number>(g, this.quality2count.count(g)));
}
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;
}
use of javafx.scene.chart.LineChart in project Gargoyle by callakrsos.
the class ScmCommitComposite method scmHistoryWalk.
private void scmHistoryWalk() throws SVNException {
List<GagoyleDate> periodDaysByWeek = DateUtil.getPeriodDaysByWeek(supplier.getWeekSize());
Collection<SVNLogEntry> allLogs = supplier.getAllLogs();
// supplier.createStream(allLogs);
TreeMap<String, Long> dayOfMonths = allLogs.stream().collect(Collectors.groupingBy(v -> FxSVNHistoryDataSupplier.YYYYMMDD_EEE_PATTERN.format(v.getDate()), () -> new TreeMap<>(), Collectors.counting()));
Map<String, Long> dayOfWeeks = new LinkedHashMap<>();
//초기값 세팅. [중요한건 정렬순서를 유지해아하므로. 초기값을 넣어준것.]
for (GagoyleDate d : DateUtil.getPeriodDaysByWeek()) {
String eee = FxSVNHistoryDataSupplier.EEE_PATTERN.format(d.toDate());
dayOfWeeks.put(eee, new Long(0));
}
//실제값 add
dayOfWeeks.putAll(allLogs.stream().collect(Collectors.groupingBy(v -> FxSVNHistoryDataSupplier.EEE_PATTERN.format(v.getDate()), Collectors.counting())));
{
BarChart<String, Long> barChartDayOfMonth = getBarChartDayOfMonth();
ObservableList<Data<String, Long>> convert = convert(FxSVNHistoryDataSupplier.YYYYMMDD_EEE_PATTERN, periodDaysByWeek, dayOfMonths, true);
Series<String, Long> series = new Series<>(SERIES_LABEL, convert);
barChartDayOfMonth.getData().add(series);
}
{
LineChart<String, Long> lineChartDayOfWeek = getLineChartDayOfWeek();
ObservableList<Data<String, Long>> convert = convert(FxSVNHistoryDataSupplier.EEE_PATTERN, DateUtil.getPeriodDaysByWeek(), dayOfWeeks, false);
Series<String, Long> series = new Series<>(SERIES_LABEL, convert);
lineChartDayOfWeek.getData().add(series);
}
}
use of javafx.scene.chart.LineChart in project Smartcity-Smarthouse by TechnionYP5777.
the class Controller method initialize.
/*
* (non-Javadoc)
*
* @see javafx.fxml.Initializable#initialize(java.net.URL,
* java.util.ResourceBundle)
*/
@Override
public void initialize(final URL location, final ResourceBundle __) {
pulseLabel.setDisable(false);
bpLabel.setDisable(false);
xAxis.setForceZeroInRange(false);
xAxis.setAutoRanging(false);
xAxis.setTickLabelsVisible(false);
xAxis.setTickMarkVisible(false);
xAxis.setMinorTickVisible(false);
final NumberAxis bpYAxis = new NumberAxis();
bpYAxis.setLabel("Blood Pressure (mmHg)");
final NumberAxis pulseXAxis = new NumberAxis();
pulseXAxis.setAutoRanging(false);
pulseXAxis.setVisible(false);
pulseXAxis.lowerBoundProperty().bind(xAxis.lowerBoundProperty());
pulseXAxis.upperBoundProperty().bind(xAxis.upperBoundProperty());
pulseXAxis.tickUnitProperty().bind(xAxis.tickUnitProperty());
final NumberAxis pulseYAxis = new NumberAxis();
pulseYAxis.setSide(Side.RIGHT);
pulseYAxis.setLabel("Pulse (BPM)");
final LineChart<Number, Number> bpLineChart = new LineChart<Number, Number>(xAxis, bpYAxis) {
@Override
protected void dataItemAdded(final Series<Number, Number> __1, final int itemIndex, final Data<Number, Number> item) {
// Remove symbols from data points
}
}, pulseLineChart = new LineChart<Number, Number>(xAxis, pulseYAxis) {
@Override
protected void dataItemAdded(final Series<Number, Number> __1, final int itemIndex, final Data<Number, Number> item) {
// Remove symbols from data points
}
};
bpLineChart.setDisable(false);
pulseLineChart.setDisable(false);
tmpSeries.setName("Pulse");
systolicSeries.setName("Systolic");
diastolicSeries.setName("Diastolic");
pulseLineChart.getData().add(pulseSeries);
bpLineChart.getData().add(tmpSeries);
bpLineChart.getData().add(systolicSeries);
bpLineChart.getData().add(diastolicSeries);
bpLineChart.lookup(".chart-content").lookup(".chart-plot-background").setStyle("-fx-background-color: transparent;");
bpLineChart.setVerticalGridLinesVisible(false);
bpLineChart.setHorizontalGridLinesVisible(false);
final Pane tmpBackPane = new Pane();
tmpBackPane.setMinSize(SIZE, Region.USE_COMPUTED_SIZE);
tmpBackPane.setMaxSize(SIZE, Region.USE_COMPUTED_SIZE);
final Pane tmpFrontPane = new Pane();
tmpFrontPane.setMinSize(SIZE, Region.USE_COMPUTED_SIZE);
tmpFrontPane.setMaxSize(SIZE, Region.USE_COMPUTED_SIZE);
backHBox.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
frontHBox.setMaxSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);
HBox.setHgrow(pulseLineChart, Priority.ALWAYS);
HBox.setHgrow(bpLineChart, Priority.ALWAYS);
VBox.setVgrow(stackPane, Priority.ALWAYS);
backHBox.getChildren().add(tmpBackPane);
backHBox.getChildren().add(pulseLineChart);
frontHBox.getChildren().add(bpLineChart);
frontHBox.getChildren().add(tmpFrontPane);
stackPane.getChildren().add(backHBox);
stackPane.getChildren().add(frontHBox);
}
use of javafx.scene.chart.LineChart in project jvarkit by lindenb.
the class QualityPerPositionChartFactory method build.
public LineChart<Number, Number> build() {
final NumberAxis xAxis = new NumberAxis();
xAxis.setLabel("Position in Read");
final NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("Read Quality");
final XYChart.Series<Number, Number> serie_mean = new XYChart.Series<Number, Number>();
serie_mean.setName("Mean Quality");
final XYChart.Series<Number, Number> serie_min = new XYChart.Series<Number, Number>();
serie_min.setName("Min Quality");
final XYChart.Series<Number, Number> serie_max = new XYChart.Series<Number, Number>();
serie_max.setName("Max Quality");
for (int x = 0; x < this.pos2qual.size(); ++x) {
final QualData q = this.pos2qual.get(x);
serie_mean.getData().add(new XYChart.Data<Number, Number>((x + 1), q.get()));
serie_min.getData().add(new XYChart.Data<Number, Number>((x + 1), q.min()));
serie_max.getData().add(new XYChart.Data<Number, Number>((x + 1), q.max()));
}
final LineChart<Number, Number> sbc = new LineChart<Number, Number>(xAxis, yAxis);
sbc.setTitle("Position/Quality");
sbc.getData().add(serie_min);
sbc.getData().add(serie_mean);
sbc.getData().add(serie_max);
sbc.setCreateSymbols(false);
return sbc;
}
Aggregations