我在绘图上使用rcharts(highcharts)绘制水平线时遇到了一些麻烦。我想使用highcharts库中的plotLines来做到这一点。下面是我的代码:
a$yAxis(title='my_Yaxis name', plotLines=list(color='red', value=10, width=2))
没有plotLines,我的图表显示没有问题。一旦我添加了plotLines,它就无法正常工作。我不确定rcharts是否在highcharts中支持plotLines?
感谢这里是否有任何专家可以提供建议。谢谢!
你好看看这个例子:
library("rCharts")
# Some data
x <- abs(rnorm(10))
# A graph with column
h <- Highcharts$new()
h$chart(type = "column")
h$series(data = x)
h$xAxis(categories = letters[1:10])
# the horizontal line
h$yAxis(title = list(text = "rnorm()"),
plotLines = list(list(
value = mean(x),
color = '#ff0000',
width = 3,
zIndex = 4,
label = list(text = "mean",
style = list( color = '#ff0000', fontWeight = 'bold' )
))))
h
list()
您的plotLines
论点中缺少a ,它需要两个list
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句