我最近发现rcharts包能够制作图表。 现在我想在雷达图表中对色段进行着色。有任何想法吗? 以下是一个简单的例子:
library(rCharts)
#create dummy dataframe with number ranging from 0 to 1
df<-data.frame(id=c("a","b","c","d","e"),val1=runif(5,0,1),val2=runif(5,0,1))
#muliply number by 100 to get percentage
df[,-1]<-df[,-1]*100
plot <- Highcharts$new()
plot$chart(polar = TRUE, type = "line",height=500)
plot$xAxis(categories=df$id, tickmarkPlacement= 'on', lineWidth= 0)
plot$yAxis(gridLineInterpolation= 'circle', lineWidth= 0, min= 0,max=100,endOnTick=T,tickInterval=10)
plot$series(data = df[,"val1"],name = "Series 1", pointPlacement="on")
plot$series(data = df[,"val2"],name = "Series 2", pointPlacement="on")
plot
导致这样的情节:
现在我想制作这个情节: