Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一组线条,宽度不同。我想在图例区域显示相同宽度的线条,有没有办法做到这一点?目前,图例在一个块中只有正确的颜色(所有行的大小相同。)
图例覆盖在画布顶部,因此您可以操纵 css 来获得此功能:
var p = $.plot(...); $.each(p.getData(), function(i, el){ $($('.legendColorBox div div')[i]).css({border: 'none', height: el.lines.lineWidth+'px', width: '20px', 'background-color': el.color}); });