public static XYChart getChart ( String chartTitle , String xTitle , String yTitle , String [ ] seriesNames , double [ ] xData , double [ ] [ ] yData ) { // Create Chart XYChart chart = new XYChart ( WIDTH , HEIGHT ) ; // Customize Chart chart . setTitle ( chartTitle ) ; chart . setXAxisTitle ( xTitle ) ; chart . setYAxisTitle ( yTitle ) ; // Series for ( int i = 0 ; i < yData . length ; i ++ ) { XYSeries series ; if ( seriesNames != null ) { series = chart . addSeries ( seriesNames [ i ] , xData , yData [ i ] ) ; } else { chart . getStyler ( ) . setLegendVisible ( false ) ; series = chart . addSeries ( " " + i , xData , yData [ i ] ) ; } series . setMarker ( SeriesMarkers . NONE ) ; } return chart ; }
Creates a Chart with multiple Series for the same X - Axis data with default style