protected BubbleChart<Number, Number> createChart() { final NumberAxis xAxis = new NumberAxis(); final NumberAxis yAxis = new NumberAxis(); final BubbleChart<Number,Number> bc = new BubbleChart<Number,Number>(xAxis,yAxis); // setup chart bc.setTitle("Advanced BubbleChart"); xAxis.setLabel("X Axis"); yAxis.setLabel("Y Axis"); // add starting data XYChart.Series<Number,Number> series1 = new XYChart.Series<Number,Number>(); series1.setName("Data Series 1"); for (int i=0; i<20; i++) series1.getData().add( new XYChart.Data<Number,Number>(Math.random()*100, Math.random()*100, (Math.random()*10))); XYChart.Series<Number,Number> series2 = new XYChart.Series<Number,Number>(); series2.setName("Data Series 2"); for (int i=0; i<20; i++) series2.getData().add( new XYChart.Data<Number,Number>(Math.random()*100, Math.random()*100, (Math.random()*10))); bc.getData().addAll(series1, series2); return bc; }
public BubbleChartSample() { NumberAxis xAxis = new NumberAxis("X", 0d, 150d, 20d); NumberAxis yAxis = new NumberAxis("Y", 0d, 150d, 20d); ObservableList<BubbleChart.Series> bubbleChartData = FXCollections.observableArrayList( new BubbleChart.Series("Series 1", FXCollections.observableArrayList( new XYChart.Data(30d, 40d, 10d), new XYChart.Data(60d, 20d, 13d), new XYChart.Data(10d, 90d, 7d), new XYChart.Data(100d, 40d, 10d), new XYChart.Data(50d, 23d, 5d))) , new BubbleChart.Series("Series 2", FXCollections.observableArrayList( new XYChart.Data(13d, 100d, 7d), new XYChart.Data(20d, 80d, 13d), new XYChart.Data(100d, 60d, 10d), new XYChart.Data(30d, 40d, 6d), new XYChart.Data(50d, 20d, 12d) )) ); BubbleChart chart = new BubbleChart(xAxis, yAxis, bubbleChartData); getChildren().add(chart); }
protected Chart createObject(Axis x_axis, Axis y_axis, double width, double height) { Series s1 = new Series( FXCollections.observableArrayList( new XYChart.Data(3, 4, 0.5), new XYChart.Data(1, 5, 0.2), new XYChart.Data(4, 6, 2) )); s1.setName("Set 1"); Series s2 = new Series( FXCollections.observableArrayList( new XYChart.Data(1, 4, 0.3), new XYChart.Data(2, 3, 0.2), new XYChart.Data(4, 2, 0.4) )); s2.setName("Set 2"); Series s3 = new Series( FXCollections.observableArrayList( new XYChart.Data(5, 4, 0.2), new XYChart.Data(1, 6, 1.2), new XYChart.Data(3, 8, 1.1) )); s3.setName("Set 3"); ObservableList data = FXCollections.observableArrayList(s1, s2, s3); BubbleChart chart = new BubbleChart(x_axis, y_axis, data); chart.setMaxSize(width, height); chart.setPrefSize(width, height); chart.setTitle("BubbleChart"); chart.setStyle("-fx-border-color: darkgray;"); return chart; }
@Override protected Chart getNewChartInstance() { NumberAxis axis1 = new NumberAxis(0, 100, 10); NumberAxis axis2 = new NumberAxis(0, 100, 10); BubbleChart chart = new BubbleChart(axis1, axis2); return chart; }
@Test public void testGetBubbleChartAdjuster() { Adjuster adjuster = Adjuster.getAdjuster(BubbleChart.class); assertThat(adjuster, is(instanceOf(RegionAdjuster.class))); assertThat(adjuster.getNodeClass(), is(sameInstance(Region.class))); }
@Override protected XYChart<Number, Number> createXYChart() { final NumberAxis xAxis = new NumberAxis(); final NumberAxis yAxis = new NumberAxis(); BubbleChart<Number, Number> chart = new BubbleChart<>(xAxis, yAxis); chart.getStyleClass().add("chart-extension"); return chart; }
public BubbleChart getNewChart() { BubbleChart chart = new BubbleChart(axis1, axis2); chart.setTitle("BubbleChart"); chart.setStyle("-fx-border-color: darkgray;"); return chart; }
public void newCharts() { final NumberAxis xAxis = new NumberAxis(40, 41, 0.1); xAxis.setLabel("lon"); final NumberAxis yAxis = new NumberAxis(40, 41, 0.1); yAxis.setLabel("lat"); blc = new BubbleChart<Number,Number>(xAxis,yAxis); tyAxis = new NumberAxis(0,1,0.1); txAxis = new NumberAxis(0,1,0.1); txAxis.setLabel("time"); tyAxis.setLabel("goal tag"); tc = new BubbleChart<Number,Number>(txAxis,tyAxis); gxAxis = new NumberAxis(-1, 1 + numObjects + numCentroids, 1); gxAxis.setLabel("goal | possibility"); final NumberAxis gyAxis = new NumberAxis(-1, 1 + numTags, 1); gyAxis.setLabel("tag"); glc = new BubbleChart<Number,Number>(gxAxis,gyAxis); HBox charts = new HBox(blc, tc); b.setCenter(charts); series1 = new XYChart.Series(); series1.setName("Goals(lon * lat)"); series2 = new XYChart.Series(); series2.setName("Possibilities(lon * lat)"); blc.getData().setAll(series1, series2); tseries1 = new XYChart.Series(); tseries1.setName("Goals(time * tag)"); tseries2 = new XYChart.Series(); tseries2.setName("Possibilities(time * tag)"); tc.getYAxis().setTickLabelsVisible(false); tc.getYAxis().setTickMarkVisible(false); tc.getYAxis().setVisible(false); tc.getData().setAll(tseries1, tseries2); // gseries1 = new XYChart.Series(); // gseries1.setName("Goals(tag)"); // gseries2 = new XYChart.Series(); // gseries2.setName("Possibilities(tag)"); // glc.getData().setAll(gseries1, gseries2); }