1.channel=odbcConnect('XXXX')
2.dd=sqlQuery(channel,"select distinct CONVERT(datetime,left(scaler,10))as date,max(amount_persecond) as cles from dm.y20120630_all where node=316 group by scaler")
3.p=qplot(date, cles, data = dd, geom = c("line","smooth"),method="lm",formula=y~ns(x,8))
4.highest <- subset(dd, cles == max(cles))
5.ss=paste("峰值:",highest[2]$cles,"\n时间:",highest[1]$date,collapse="\n")
6.p+geom_point(aes(x=highest[1]$date,y=highest[2]$cles),colour="red",size=5)+geom_text(aes(highest[1]$date, highest[2]$cles, label = paste("****",ss)),hjust = 1, vjust = 1, size = 4)