1.import Javafx.application.application;2.import Javafx.collections.fxcollections;3.import Javafx.collections.observablelist;4.import Javafx.scene.scene;5.import Javafx.stage.stage;6.import Javafx.scene.chart.*;7.import javafx.scene.group;8. 9.public class Piechartsample extends application {10. @Override public void Start (stage stage) {12. Scene scene = new Scene (new Group ()); 13. Stage.settitle ("Imported Fruits"); 14. Stage.setwidth (500); 15. Stage.setheight (500); 16. Observablelist<piechart.data> Piechartdata =18. Fxcollections.observablearraylist (19. New Piechart.data ("Grapefruit", 13), 20. New Piechart.data ("Oranges", 25), 21. New Piechart.data ("Plums", 10), 22. New Piechart.data ("Pears", 22), 23. New Piechart.data ("Apples", 30)); 24. Final Piechart chart = new Piechart (piechartdata); 25. Chart.settitle ("fruit"); 26 .....
Example of a chart developed by JavaFX