开发者

Showing line with the right lineWidth in legend

I have a group of lines, with different width. I would like to show the same width of lines in the legend area, is there a way to do that? Currently, the legend only has the right color in a b开发者_开发百科lock (same size for all the lines.)


The legend is overlaid on top of the canvas so you can manipulate the css to get this functionality:

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}); 
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜