GuideLineLayer我正在尝试从 Plottable.js中找到一种简单的方法来为 a着色。
到目前为止,我尝试了以下方法。
1)试图在attr()里面使用onAnchor()
这会将attr添加到g包含该line元素的元素中,但似乎没有任何效果。会不会是 CSS 优先级?
var guidelineMax = new Plottable.Components.GuideLineLayer('horizontal')
.value(222)
.onAnchor(function(c) {
c.content().attr('stroke', '#F00')
})
.scale(yScale)
2) 使用addClass()
这完全不直观,因为它为图表的边界着色,而不是指引线。

.red {
stroke: #F00;
}
var guidelineMax = new Plottable.Components.GuideLineLayer('horizontal')
.value(state[state.param].max)
.addClass('red')
.scale(yScale)