private void createChart() { xAxis = new NumberAxis(); xAxis.setForceZeroInRange(false); xAxis.setAutoRanging(true); xAxis.setLabel(priceColumnLabel.get()); yAxis = new NumberAxis(); yAxis.setForceZeroInRange(false); yAxis.setAutoRanging(true); yAxis.setLabel("Amount in BTC"); yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis, "", "")); seriesBuy = new XYChart.Series(); seriesBuy.setName("Offers for buy bitcoin "); seriesSell = new XYChart.Series(); seriesSell.setName("Offers for sell bitcoin"); areaChart = new AreaChart<>(xAxis, yAxis); areaChart.setAnimated(false); areaChart.setId("charts"); areaChart.setMinHeight(300); areaChart.setPadding(new Insets(0, 30, 10, 0)); areaChart.getData().addAll(seriesBuy, seriesSell); }
protected AreaChart<Number, Number> createChart() { final NumberAxis xAxis = new NumberAxis(0, 128, 8); final NumberAxis yAxis = new NumberAxis(0, 50, 10); final AreaChart<Number, Number> ac = new AreaChart<Number, Number>(xAxis, yAxis); // setup chart ac.setId("audioAreaDemo"); ac.setLegendVisible(false); ac.setTitle("Live Audio Spectrum Data"); ac.setAnimated(false); xAxis.setLabel("Frequency Bands"); yAxis.setLabel("Magnitudes"); yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis, null, "dB")); // add starting data XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>(); series.setName("Audio Spectrum"); //noinspection unchecked series1Data = new XYChart.Data[(int) xAxis.getUpperBound()]; for (int i = 0; i < series1Data.length; i++) { series1Data[i] = new XYChart.Data<Number, Number>(i, 50); series.getData().add(series1Data[i]); } ac.getData().add(series); return ac; }