Stacked area chart is the extension of the basic area charts in which the evolution of the values of several groups on the same graphic is displayed. The area is plotted for all the data points of a certain group. However, the areas of the different groups are shown in the form of a stack but they don't overlap each other. The stacked area chart is mainly used to trace the comparison between the values of the two groups.
In the following image, the population of different states is shown. The population of men and women are represented by the two different area where the area representing the women population is plotted onto the area representing the women population. On the X-axis, some states are plotted while, on the Y-axis, the population (in crores) is plotted.
In JavaFX, the class javafx.scene.chart.StackedAreaChart is used to represent the stacked area chart. We need to instantiate this class in order to generate a Stacked-Area-Chart node.
The class contains only one property that is described along with its setter method in the following table.
There are two constructors in the class.
In the following example, we have shown the comparison between the sales of a company in two different years.