Use ggplot2 to map the variables to the aesthetics just as you described. You don't want type on the y-axis - you want type on another axis, in this case fill for stacks of different colors. The default y aesthetic for a bar plot is count.
mydata <- read.csv(
text = "s no,type,state
ggplot(mydata, aes(x = state, fill = type)) +