Overwrite the legend container instead of appending to it

git-svn-id: https://flot.googlecode.com/svn/trunk@71 1e0a6537-2640-0410-bfb7-f154510ff394
pull/1/head
olau@iola.dk 18 years ago
parent c60b93056f
commit 09b37caf41

@ -140,7 +140,8 @@ background.
If you want the legend to appear somewhere else in the DOM, you can
specify "container" as a jQuery object to put the legend table into.
The "position" and "margin" etc. options will then be ignored.
The "position" and "margin" etc. options will then be ignored. Note
that it will overwrite the contents of the container.

@ -16,6 +16,10 @@ multiple plots aligned.
The "fill" option can now be a number that specifies the opacity of
the fill.
Using the "container" option in legend now overwrites the container
element instead of just appending to it (fixes infinite legend bug,
reported by several people, fix by Brad Dewey).
Fixed a bug in calculating spacing around the plot (reported by
timothytoe). Fixed a bug in finding max values for all-negative data
sets. Prevent the possibility of eternal looping in tick calculations.

@ -1345,7 +1345,7 @@
if (fragments.length > 0) {
var table = '<table style="font-size:smaller;color:' + options.grid.color + '">' + fragments.join("") + '</table>';
if (options.legend.container != null)
options.legend.container.append(table);
options.legend.container.html(table);
else {
var pos = "";
var p = options.legend.position, m = options.legend.margin;

Loading…
Cancel
Save