Amazing technological breakthrough possible @S-Logix

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • +91- 81240 01111

Social List

How to implement Area Chart using ggplot2 in R?


To implement the area chart using ggplot2 in R programming.


Package and Function:

   R Package : ggplot2

   R Function :ggplot(x, aes(x= , y= ), fill= )

   R Function : geom_area(colour =)

x - Data Set

aes- Aesthetic mappings describe

   how variables in the data are mapped to visual properties (aesthetics) of geoms.

   Aesthetic mappings can be set in ggplot2() and in individual layers.

Sapmle Code

#Area Chart Using ggplot2

#Loading required Packages







input<-read.xlsx(“OnlineShopping.xlsx”,sheetIndex = 1)



#Area Chart

ggplot(input,aes(x=income,y=age,fill=commodity)) + geom_area()

ggplot(input,aes(x=income,y=age,fill=commodity)) + geom_area(colour=”Black”)

implement Area Chart using ggplot2 in R
Area Chart Using ggplot2
Loading required Packages