apps/samples/Ensemble8/src/samples/java/ensemble/samples/charts/bubble/BubbleChartApp.java

Print this page




  33 
  34 
  35 import javafx.application.Application;
  36 import javafx.scene.Parent;
  37 import javafx.scene.Scene;
  38 import javafx.scene.chart.BubbleChart;
  39 import javafx.scene.chart.NumberAxis;
  40 import javafx.scene.chart.XYChart;
  41 import javafx.stage.Stage;
  42 
  43 
  44 /**
  45  * An advanced bubble chart with a variety of actions and settable properties.
  46  *
  47  * @sampleName Bubble Chart
  48  * @preview preview.png
  49  * @see javafx.scene.chart.BubbleChart
  50  * @see javafx.scene.chart.NumberAxis
  51  * @related /Charts/Scatter/Scatter Chart
  52  * @playground chart.data
  53  * 
  54  * @playground - (name="xAxis")
  55  * @playground xAxis.autoRanging
  56  * @playground xAxis.forceZeroInRange
  57  * @playground xAxis.lowerBound (min=-100,max=100,step=1)
  58  * @playground xAxis.upperBound (min=0,max=200,step=1)
  59  * @playground xAxis.tickUnit (step=1)
  60  * @playground xAxis.minorTickCount (max=16)
  61  * @playground xAxis.minorTickLength (max=15)
  62  * @playground xAxis.minorTickVisible
  63  * 
  64  * @playground xAxis.animated
  65  * @playground xAxis.label
  66  * @playground xAxis.side
  67  * @playground xAxis.tickLabelFill
  68  * @playground xAxis.tickLabelGap
  69  * @playground xAxis.tickLabelRotation (min=-180,max=180)
  70  * @playground xAxis.tickLabelsVisible
  71  * @playground xAxis.tickLength
  72  * @playground xAxis.tickMarkVisible
  73  * 
  74  * @playground - (name="yAxis")
  75  * @playground yAxis.autoRanging
  76  * @playground yAxis.forceZeroInRange
  77  * @playground yAxis.lowerBound (min=-100,max=100,step=1)
  78  * @playground yAxis.upperBound (min=0,max=200,step=1)
  79  * @playground yAxis.tickUnit (step=1)
  80  * @playground yAxis.minorTickCount (max=16)
  81  * @playground yAxis.minorTickLength (max=15)
  82  * @playground yAxis.minorTickVisible
  83  * 
  84  * @playground yAxis.animated
  85  * @playground yAxis.label
  86  * @playground yAxis.side
  87  * @playground yAxis.tickLabelFill
  88  * @playground yAxis.tickLabelGap
  89  * @playground yAxis.tickLabelRotation (min=-180,max=180)
  90  * @playground yAxis.tickLabelsVisible
  91  * @playground yAxis.tickLength
  92  * @playground yAxis.tickMarkVisible
  93  * 
  94  * @playground - (name="chart")
  95  * @playground chart.horizontalGridLinesVisible
  96  * @playground chart.horizontalZeroLineVisible
  97  * @playground chart.verticalGridLinesVisible
  98  * @playground chart.verticalZeroLineVisible
  99  * 
 100  * @playground chart.animated
 101  * @playground chart.legendSide
 102  * @playground chart.legendVisible
 103  * @playground chart.title
 104  * @playground chart.titleSide
 105  */
 106 public class BubbleChartApp extends Application {
 107 
 108     private BubbleChart<Number, Number> chart = createChart();
 109     private NumberAxis xAxis;
 110     private NumberAxis yAxis;
 111 
 112     private BubbleChart<Number, Number> createChart() {
 113         xAxis = new NumberAxis();
 114         yAxis = new NumberAxis();
 115         final BubbleChart<Number, Number> bc = new BubbleChart<>(xAxis, yAxis);
 116         // setup chart
 117         bc.setTitle("Advanced BubbleChart");
 118         xAxis.setLabel("X Axis");
 119         yAxis.setLabel("Y Axis");




  33 
  34 
  35 import javafx.application.Application;
  36 import javafx.scene.Parent;
  37 import javafx.scene.Scene;
  38 import javafx.scene.chart.BubbleChart;
  39 import javafx.scene.chart.NumberAxis;
  40 import javafx.scene.chart.XYChart;
  41 import javafx.stage.Stage;
  42 
  43 
  44 /**
  45  * An advanced bubble chart with a variety of actions and settable properties.
  46  *
  47  * @sampleName Bubble Chart
  48  * @preview preview.png
  49  * @see javafx.scene.chart.BubbleChart
  50  * @see javafx.scene.chart.NumberAxis
  51  * @related /Charts/Scatter/Scatter Chart
  52  * @playground chart.data

  53  * @playground - (name="xAxis")
  54  * @playground xAxis.autoRanging
  55  * @playground xAxis.forceZeroInRange
  56  * @playground xAxis.lowerBound (min=-100,max=100,step=1)
  57  * @playground xAxis.upperBound (min=0,max=200,step=1)
  58  * @playground xAxis.tickUnit (step=1)
  59  * @playground xAxis.minorTickCount (max=16)
  60  * @playground xAxis.minorTickLength (max=15)
  61  * @playground xAxis.minorTickVisible

  62  * @playground xAxis.animated
  63  * @playground xAxis.label
  64  * @playground xAxis.side
  65  * @playground xAxis.tickLabelFill
  66  * @playground xAxis.tickLabelGap
  67  * @playground xAxis.tickLabelRotation (min=-180,max=180)
  68  * @playground xAxis.tickLabelsVisible
  69  * @playground xAxis.tickLength
  70  * @playground xAxis.tickMarkVisible

  71  * @playground - (name="yAxis")
  72  * @playground yAxis.autoRanging
  73  * @playground yAxis.forceZeroInRange
  74  * @playground yAxis.lowerBound (min=-100,max=100,step=1)
  75  * @playground yAxis.upperBound (min=0,max=200,step=1)
  76  * @playground yAxis.tickUnit (step=1)
  77  * @playground yAxis.minorTickCount (max=16)
  78  * @playground yAxis.minorTickLength (max=15)
  79  * @playground yAxis.minorTickVisible

  80  * @playground yAxis.animated
  81  * @playground yAxis.label
  82  * @playground yAxis.side
  83  * @playground yAxis.tickLabelFill
  84  * @playground yAxis.tickLabelGap
  85  * @playground yAxis.tickLabelRotation (min=-180,max=180)
  86  * @playground yAxis.tickLabelsVisible
  87  * @playground yAxis.tickLength
  88  * @playground yAxis.tickMarkVisible

  89  * @playground - (name="chart")
  90  * @playground chart.horizontalGridLinesVisible
  91  * @playground chart.horizontalZeroLineVisible
  92  * @playground chart.verticalGridLinesVisible
  93  * @playground chart.verticalZeroLineVisible

  94  * @playground chart.animated
  95  * @playground chart.legendSide
  96  * @playground chart.legendVisible
  97  * @playground chart.title
  98  * @playground chart.titleSide
  99  */
 100 public class BubbleChartApp extends Application {
 101 
 102     private BubbleChart<Number, Number> chart = createChart();
 103     private NumberAxis xAxis;
 104     private NumberAxis yAxis;
 105 
 106     private BubbleChart<Number, Number> createChart() {
 107         xAxis = new NumberAxis();
 108         yAxis = new NumberAxis();
 109         final BubbleChart<Number, Number> bc = new BubbleChart<>(xAxis, yAxis);
 110         // setup chart
 111         bc.setTitle("Advanced BubbleChart");
 112         xAxis.setLabel("X Axis");
 113         yAxis.setLabel("Y Axis");