Search in sources :

Example 6 with LineChart

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

Example 7 with LineChart

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);
    }
}
Also used : MouseButton(javafx.scene.input.MouseButton) ListView(javafx.scene.control.ListView) GagoyleDate(com.kyj.fx.voeditor.visual.framework.model.GagoyleDate) MouseEvent(javafx.scene.input.MouseEvent) LoggerFactory(org.slf4j.LoggerFactory) Series(javafx.scene.chart.XYChart.Series) SimpleDateFormat(java.text.SimpleDateFormat) XYChart(javafx.scene.chart.XYChart) LinkedHashMap(java.util.LinkedHashMap) LineChart(javafx.scene.chart.LineChart) ContextMenu(javafx.scene.control.ContextMenu) Map(java.util.Map) FxCollectors(com.kyj.fx.voeditor.visual.util.FxCollectors) Color(javafx.scene.paint.Color) Logger(org.slf4j.Logger) Label(javafx.scene.control.Label) MenuItem(javafx.scene.control.MenuItem) SVNException(org.tmatesoft.svn.core.SVNException) Data(javafx.scene.chart.XYChart.Data) Collection(java.util.Collection) Node(javafx.scene.Node) Set(java.util.Set) MasterSlaveChartComposite(com.kyj.fx.voeditor.visual.component.MasterSlaveChartComposite) BarChart(javafx.scene.chart.BarChart) Collectors(java.util.stream.Collectors) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) List(java.util.List) TreeMap(java.util.TreeMap) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) ValueUtil(kyj.Fx.dao.wizard.core.util.ValueUtil) DateUtil(com.kyj.fx.voeditor.visual.util.DateUtil) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) SVNLogEntry(org.tmatesoft.svn.core.SVNLogEntry) GagoyleDate(com.kyj.fx.voeditor.visual.framework.model.GagoyleDate) TreeMap(java.util.TreeMap) LinkedHashMap(java.util.LinkedHashMap) Series(javafx.scene.chart.XYChart.Series) ObservableList(javafx.collections.ObservableList) BarChart(javafx.scene.chart.BarChart) LineChart(javafx.scene.chart.LineChart)

Example 8 with LineChart

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);
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane) LineChart(javafx.scene.chart.LineChart)

Example 9 with LineChart

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

Aggregations

LineChart (javafx.scene.chart.LineChart)9 XYChart (javafx.scene.chart.XYChart)7 NumberAxis (javafx.scene.chart.NumberAxis)6 Data (javafx.scene.chart.XYChart.Data)3 Series (javafx.scene.chart.XYChart.Series)3 Label (javafx.scene.control.Label)3 BorderPane (javafx.scene.layout.BorderPane)3 SVNLogEntry (org.tmatesoft.svn.core.SVNLogEntry)3 MasterSlaveChartComposite (com.kyj.fx.voeditor.visual.component.MasterSlaveChartComposite)2 GagoyleDate (com.kyj.fx.voeditor.visual.framework.model.GagoyleDate)2 DateUtil (com.kyj.fx.voeditor.visual.util.DateUtil)2 FxCollectors (com.kyj.fx.voeditor.visual.util.FxCollectors)2 FxUtil (com.kyj.fx.voeditor.visual.util.FxUtil)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Collection (java.util.Collection)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2 TreeMap (java.util.TreeMap)2