1
尝试将文本标签置于flax中xaxis下方的条形图下方。
从海军报原来的标记看起来是这样的:在flot中移动xaxis标签
<div style="position: absolute; text-align: center; left: -20px; top: 185px; width: 79px;" class="tickLabel"><span class="chart-label">Lorem</span></div>
我想要的结果标签标记看起来是这样的:
<div style="position: absolute; text-align: center; left: 0px; top: 185px; width: 79px;" class="tickLabel"><span class="chart-label">Lorem</span></div>
此代码迄今所做的伎俩,但我不知道是否有一种更好的对齐标签的方法。
$.each($('.chart-label'),function(idx,el){
var c = $(el);
var value = c.parent().css('left');
c.parent().css('left',parseInt(value)+20+'px');
});
我不能重写在CSS中的位置,因为左侧的属性是内联的。单独