@FXML LineChartOutput:Chart; ... /* when is TRUE, is problem with X axis labels */ Chart.setAnimated( false ); /* -- get axis */ CategoryAxis bottomAxis = (CategoryAxis) Chart.getXAxis(); Axis leftAxis = Chart.getYAxis(); /* -- set axis title */ bottomAxis.setLabel( "Bottom axis" ); leftAxis.setLabel( "Left axis" ); /* -- create series */ /* first */ Series serie = new XYChart.Series (); serie.setName( "First" ); serie.getData().add( new XYChart.Data( "Jan", 23 ) ); serie.getData().add( new XYChart.Data( "Feb", 32 ) ); serie.getData().add( new XYChart.Data( "Mar", 50 ) ); /* second */ Series serie2 = new XYChart.Series (); serie2.setName( "Second" ); serie2.getData().add( new XYChart.Data( "Jan", 100 ) ); serie2.getData().add( new XYChart.Data( "Feb", 72 ) ); serie2.getData().add( new XYChart.Data( "Mar", 20 ) ); /* remove point symbols */ Chart.setCreateSymbols(false); /* add series to chart */ Chart.getData().clear(); Chart.getData().add( serie ); Chart.getData().add( serie2 );
Microsoft AX 2012, X++, C#, SQL server, SSRS, Java, JavaFX, Oracle, PL/SQL, Delphi - codes examples, step-by-step tutorials, experiences.
Friday, May 3, 2019
JAVAFX - How to fill LineChart
This LineChart has X String axis and Y Number axis.
Subscribe to:
Posts (Atom)