我使用包amCharts
在R
中创建了一个简单的rAmCharts
。对于我的数据,此图表很简单XY chart
,我想在图表线下填充区域直到x轴。
Dat = data.frame(x = 0:10, y = c(9, 11, 4,7,8,9,7,6,2, 2,1))
amXYChart(x = Dat$x, y = Dat$y) %>%
setDataProvider(dataProvider = Dat, keepNA = TRUE) %>%
addGraph(xField = "x", yField = "y", lineColor = '#058e54', fillAlphas = 0.5, bullet = "round", lineThickness = 1, bulletColor = "transparent")
如你所见,amCharts正在生成一个看起来很奇怪的情节,它无法填充该区域直到x轴。
我尝试添加参数fillToAxis = "x"
,如下所示,然后图表根本没有填充该区域。
addGraph(xField = "x", yField = "y", lineColor = '#058e54', fillAlphas = 0.5, bullet = "round", lineThickness = 1, bulletColor = "transparent", fillToAxis = "x")
如果有人指导我使用正确的代码填充x轴上的区域,我将非常感激。
谢谢,
答案 0 :(得分:1)