apps/samples/Ensemble8/src/samples/java/ensemble/samples/charts/area/curvefitted/CurveFittedAreaChartApp.java

Print this page




  31  */
  32 package ensemble.samples.charts.area.curvefitted;
  33 
  34 import javafx.application.Application;
  35 import javafx.scene.Parent;
  36 import javafx.scene.Scene;
  37 import javafx.scene.chart.NumberAxis;
  38 import javafx.scene.chart.XYChart;
  39 import javafx.stage.Stage;
  40 
  41 /**
  42  * An area chart that demonstrates curve fitting. Styling is done through CSS.
  43  *
  44  * @sampleName Curve-Fitted Area Chart
  45  * @preview preview.png
  46  * @see javafx.scene.chart.AreaChart
  47  * @see javafx.scene.chart.NumberAxis
  48  * @related /Charts/Area/Area Chart
  49  * @docUrl http://docs.oracle.com/javafx/2/charts/jfxpub-charts.htm Using JavaFX Charts Tutorial
  50  * @playground chart.data
  51  * 
  52  * @playground - (name="xAxis")
  53  * @playground xAxis.autoRanging
  54  * @playground xAxis.forceZeroInRange
  55  * @playground xAxis.lowerBound (min=-10000,max=10000,step=1)
  56  * @playground xAxis.upperBound (min=-10000,max=10000,step=1)
  57  * @playground xAxis.tickUnit (max=10000,step=1)
  58  * @playground xAxis.minorTickCount (max=16)
  59  * @playground xAxis.minorTickLength (max=15)
  60  * @playground xAxis.minorTickVisible
  61  * 
  62  * @playground xAxis.animated
  63  * @playground xAxis.side
  64  * @playground xAxis.tickLabelFill
  65  * @playground xAxis.tickLabelGap
  66  * @playground xAxis.tickLabelRotation (min=-180,max=180,step=1)
  67  * @playground xAxis.tickLabelsVisible
  68  * @playground xAxis.tickLength
  69  * @playground xAxis.tickMarkVisible
  70  * 
  71  * @playground - (name="yAxis")
  72  * @playground yAxis.autoRanging
  73  * @playground yAxis.forceZeroInRange
  74  * @playground yAxis.lowerBound (min=-1000, max=1000,step=1)
  75  * @playground yAxis.upperBound (min=-1000, max=2000,step=1)
  76  * @playground yAxis.tickUnit (max=1000,step=1)
  77  * @playground yAxis.minorTickCount (max=16)
  78  * @playground yAxis.minorTickLength (max=15)
  79  * @playground yAxis.minorTickVisible
  80  * 
  81  * @playground yAxis.animated
  82  * @playground yAxis.side
  83  * @playground yAxis.tickLabelFill
  84  * @playground yAxis.tickLabelGap
  85  * @playground yAxis.tickLabelRotation (min=-180,max=180,step=1)
  86  * @playground yAxis.tickLabelsVisible
  87  * @playground yAxis.tickLength
  88  * @playground yAxis.tickMarkVisible
  89  * 
  90  * @playground - (name="chart")
  91  * @playground chart.horizontalGridLinesVisible
  92  * @playground chart.horizontalZeroLineVisible
  93  * @playground chart.verticalGridLinesVisible
  94  * @playground chart.verticalZeroLineVisible
  95  * 
  96  * @playground chart.animated
  97  * @playground chart.legendSide
  98  * @playground chart.legendVisible
  99  * @playground chart.title
 100  * @playground chart.titleSide
 101  */
 102 public class CurveFittedAreaChartApp extends Application {
 103     
 104     private CurveFittedAreaChart chart;
 105     private NumberAxis xAxis;
 106     private NumberAxis yAxis;
 107 
 108     public Parent createContent() {
 109         xAxis = new NumberAxis(0, 10000, 2500);
 110         yAxis = new NumberAxis(0, 1000, 200);
 111         chart = new CurveFittedAreaChart(xAxis, yAxis);
 112         chart.setLegendVisible(false);
 113         chart.setHorizontalGridLinesVisible(false);
 114         chart.setVerticalGridLinesVisible(false);
 115         chart.setAlternativeColumnFillVisible(false);




  31  */
  32 package ensemble.samples.charts.area.curvefitted;
  33 
  34 import javafx.application.Application;
  35 import javafx.scene.Parent;
  36 import javafx.scene.Scene;
  37 import javafx.scene.chart.NumberAxis;
  38 import javafx.scene.chart.XYChart;
  39 import javafx.stage.Stage;
  40 
  41 /**
  42  * An area chart that demonstrates curve fitting. Styling is done through CSS.
  43  *
  44  * @sampleName Curve-Fitted Area Chart
  45  * @preview preview.png
  46  * @see javafx.scene.chart.AreaChart
  47  * @see javafx.scene.chart.NumberAxis
  48  * @related /Charts/Area/Area Chart
  49  * @docUrl http://docs.oracle.com/javafx/2/charts/jfxpub-charts.htm Using JavaFX Charts Tutorial
  50  * @playground chart.data

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

  60  * @playground xAxis.animated
  61  * @playground xAxis.side
  62  * @playground xAxis.tickLabelFill
  63  * @playground xAxis.tickLabelGap
  64  * @playground xAxis.tickLabelRotation (min=-180,max=180,step=1)
  65  * @playground xAxis.tickLabelsVisible
  66  * @playground xAxis.tickLength
  67  * @playground xAxis.tickMarkVisible

  68  * @playground - (name="yAxis")
  69  * @playground yAxis.autoRanging
  70  * @playground yAxis.forceZeroInRange
  71  * @playground yAxis.lowerBound (min=-1000, max=1000,step=1)
  72  * @playground yAxis.upperBound (min=-1000, max=2000,step=1)
  73  * @playground yAxis.tickUnit (max=1000,step=1)
  74  * @playground yAxis.minorTickCount (max=16)
  75  * @playground yAxis.minorTickLength (max=15)
  76  * @playground yAxis.minorTickVisible

  77  * @playground yAxis.animated
  78  * @playground yAxis.side
  79  * @playground yAxis.tickLabelFill
  80  * @playground yAxis.tickLabelGap
  81  * @playground yAxis.tickLabelRotation (min=-180,max=180,step=1)
  82  * @playground yAxis.tickLabelsVisible
  83  * @playground yAxis.tickLength
  84  * @playground yAxis.tickMarkVisible

  85  * @playground - (name="chart")
  86  * @playground chart.horizontalGridLinesVisible
  87  * @playground chart.horizontalZeroLineVisible
  88  * @playground chart.verticalGridLinesVisible
  89  * @playground chart.verticalZeroLineVisible

  90  * @playground chart.animated
  91  * @playground chart.legendSide
  92  * @playground chart.legendVisible
  93  * @playground chart.title
  94  * @playground chart.titleSide
  95  */
  96 public class CurveFittedAreaChartApp extends Application {
  97     
  98     private CurveFittedAreaChart chart;
  99     private NumberAxis xAxis;
 100     private NumberAxis yAxis;
 101 
 102     public Parent createContent() {
 103         xAxis = new NumberAxis(0, 10000, 2500);
 104         yAxis = new NumberAxis(0, 1000, 200);
 105         chart = new CurveFittedAreaChart(xAxis, yAxis);
 106         chart.setLegendVisible(false);
 107         chart.setHorizontalGridLinesVisible(false);
 108         chart.setVerticalGridLinesVisible(false);
 109         chart.setAlternativeColumnFillVisible(false);