当为折线图轴绘制自定义标签时,标签的旋转与轴重叠。如何解决这个问题?我尝试搜索文档并发现 Element.transform() 将用于旋转而不是 rotate() 因为它已贬值,但我无法使其工作。有人可以帮忙吗?
var lines1 = r.linechart(100, 50, 950, 470, x,
y, {
smooth : false,
symbol : 'circle',
axis : "0 0 1 1",
axisxstep: 20,
axisystep:20
}).hoverColumn(function () {
this.tags = r.set();
for (var i = 0, ii = this.y.length; i < ii; i++) {
this.tags.push(r.tag(this.x, this.y[i], this.values[i], 160, 5).insertBefore(this).attr([{ fill: "#fff" }, { fill: this.symbols[i].attr("fill") }]));
}
}, function () {
this.tags && this.tags.remove();
});
var axisItems = lines1.axis[0].text.items
for( var i = 0, l = axisItems.length; i < l; i++ ) {
var date = new Date(parseInt(axisItems[i].attr("text")));
axisItems[i].rotate(270,this.x ,this.y);
axisItems[i].attr("text", dateFormat(date, "dmmm,htt"));
}