Found 9291 Articles for Object Oriented Programming

How to move the x-axis to top in a JavaFX line chart?

Maruthi Krishna
Updated on 20-May-2020 08:16:10

358 Views

Inline chart, the data values have represented a series of points connected by a line. In JavaFX, you can create a line chart by instantiating the javafx.scene.chart.LineChart class.By default, A JavaFX Line chart contains symbols pointing out the values in the series along the x-axis. Typically, these are small circles.The X-Axis on the bottom in the plot.Y-Axis on the left.Moving the X-Axis to topThe Axis class (superclass of all axes) has a property named side, this specifies the side of the plot at which you need to have the current axis (left, right, top-bottom). You can set the value to ... Read More

What are symbols in a JavaFX line chart. How to disable them?

Maruthi Krishna
Updated on 20-May-2020 08:13:17

621 Views

Inline chart the data values have represented a series of points connected by a line. In JavaFX, you can create a line chart by instantiating the javafx.scene.chart.LineChart class.By default, A JavaFX Line chart contains symbols pointing out the values in the series along the x-axis. Typically, these are small circles.The X-Axis on the bottom in the plot.Y-Axis on the left.Disabling the symbolsThe LineChart class has a property named createSymbols (boolean), which specifies whether to create symbols for data items in the chart. You can set values to this method using the setCreateSymbols() method.To remove symbols from a line chart you ... Read More

JavaFX line chart example with multiple series (lines)

Maruthi Krishna
Updated on 20-May-2020 08:09:58

966 Views

Inline chart, the data values have represented a series of points connected by a line. In JavaFX, you can create a line chart by instantiating the javafx.scene.chart.LineChart class.While instantiating this class you must pass the two objects of the Axis class representing the x and y-axis (as parameters of the constructor). Since the Axis class is abstract you need to pass objects of its concrete subclasses, NumberAxis (for numerical values) or, CategoryAxis (String values).Line chart with multiple seriesThe XYChart.Data class represents a data point in the chart, you can create a data point by instantiating this class.XYChart.Data dataPoint1 = new ... Read More

JavaFX LineChart example with category axis

Maruthi Krishna
Updated on 20-May-2020 08:07:00

830 Views

Inline chart, the data values have represented a series of points connected by a line. In JavaFX, you can create a line chart by instantiating the javafx.scene.chart.LineChart class.While instantiating this class you must pass the two objects of the Axis class representing the x and y-axis (as parameters of the constructor). Since the Axis class is abstract you need to pass objects of its concrete subclasses, NumberAxis (for numerical values) or, CategoryAxis (String values).ExampleFollowing is an example demonstrating the usage of the category axis. Here, We are plotting the sales of various models of OnePlus mobile, we are using the ... Read More

How to set the slices of a JavaFX PieChart in anti-clockwise direction?

Maruthi Krishna
Updated on 20-May-2020 08:04:10

92 Views

The pie chart is a data a circular statistical graphic, where the data values are represented as the slices of a circle. Each slice is differentiated from other (typically by color). In JavaFX, you can create a pie chart by instantiating the javafx.scene.chart.PieChart class.Changing the direction of the slicesThe angle at which the first slice of a PieChart is started is known as start angle and you can set this value using the setStartAngle() method (by default, 0).The PieChart class provides a property (boolean) known as clockWise specifying whether the slices of the current PieChart are in a clockwise direction ... Read More

How to remove the legend of a PieChart in JavaFX?

Maruthi Krishna
Updated on 20-May-2020 08:01:23

401 Views

In the pie chart, we represent the data values as slices of a circle. Each slice is differentiated from other (typically by color). In JavaFX, you can create a pie chart by instantiating the javafx.scene.chart.PieChart class.By default, a JavaFX pie chart contains labels of the slices and a legend − a bar with colors specifying the category represented by each color.Making the legend invisibleThe PieChart class has a property named legendVisible (inherited from the class Chart). It is of type boolean and, you can set the value to it using the setLegendVisible() method.By default, the value of the legendVisible property ... Read More

How to change the position of the legend in a PieChart in JavaFX?

Maruthi Krishna
Updated on 20-May-2020 07:59:14

586 Views

In the pie chart, we represent the data values as slices of a circle. Each slice is differentiated from other (typically by color). In JavaFX, you can create a pie chart by instantiating the javafx.scene.chart.PieChart class.By default, a JavaFX pie chart contains labels of the slices and a legend − a bar with colors specifying the category represented by each color.Changing the position of the Legend −The PieChart class has a property named legendSide (inherited from the Chart class). This specifies the position of the legend in the chart (left, right, top-bottom). You can set the value to this property ... Read More

How to create a TabPane in JavaFX?

Maruthi Krishna
Updated on 20-May-2020 07:56:51

2K+ Views

A TabPane is a GUI component using which you can load multiple documents in a single window. A tab pane has a title area and a content area, you can switch between tabs by clicking on their respective title. You can create tab pane by instantiating the javafx.scene.control.TabPane class.Creating TabsEach tab in a tab-pane is represented by the javafx.scene.control.Tab class, you can set the title and content of a tab using the setText() and setContent() methods of this class respectively.Once you create all the required tabs you need to add them to the pane as −tabPane.getTabs().addAll(tab1, tab2);ExampleFollowing JavaFX program demonstrates ... Read More

How to create a SplitPane in JavaFX?

Maruthi Krishna
Updated on 20-May-2020 07:52:21

624 Views

A SplitPane is a UI component that contains two or more sides with a separator in between. This separator is movable; you can reduce/increase the area of a side using it. You can create a split pane by instantiating the javafx.scene.control.SplitPane class.The sides of the SplitPane can be arranged either horizontally or vertically. By default, the SpliPane created is horizontal you can change its orientation using the setOrientation() method.ExampleThe following Example demonstrates the creation of a SplitPane.import java.io.FileInputStream; import java.io.FileNotFoundException; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.SplitPane; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class SplitPaneExample extends ... Read More

How to create a SplitMenuButton in JavaFX?

Maruthi Krishna
Updated on 20-May-2020 07:50:07

437 Views

A menu is a list of options or commands presented to the user, typically menus contain items that perform some action. The contents of a menu are known as menu items and a menu bar holds multiple menus.A button controls in user interface applications, in general, on clicking the button it performs the respective action.A SplitMenuButton provides the functionality of both buttons and a Menu. It is divided into two areas − action area and, menu area. On clicking either of these areas it shows the respective functionality.You can create a split menu button by instantiating the javafx.scene.control.SplitMenuButton class.ExampleThe following ... Read More

Advertisements