how to show legend in graphs using flot

Posted by robezy on Stack Overflow See other posts from Stack Overflow or by robezy
Published on 2010-05-15T08:21:36Z Indexed on 2010/05/15 8:24 UTC
Read the original article Hit count: 217

Filed under:
|

Hi,

I'm using flot library to show plot graph. I need to show the legend in a separate div.

Quoted from flot api.

If you want the legend to appear somewhere else in the DOM, you can specify "container" as a jQuery object/expression to put the legend table into.

So i wrote the legend options as below.

"legend":{"show":true,"container":"jQuery("#placeholder")"}}

Unfortunately it is not showing anything? is this the correct way of writing legend option? One good thing is it not showing default legend. so i guess the problem is with way i wrote the container .

Any thoughts? Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about flot