Added the plot function as a chainable property. #953

Merged
merged 3 commits into from Feb 9, 2013

Projects

None yet

1 participant

Owner
dnschnur commented Feb 8, 2013

This implements a long-standing enhancement of being able to create a plot like this:

$("#placeholder").plot(data, options);

This form supports standard jQuery chaining, making it quite convenient when the placeholder is the result of a stream of jQuery calls, or when additional calls need to be made after the plot is created.

The disadvantage of this form is that it provides no way to return the plot object. This isn't a big deal, though, since users can easily retrieve it via the 'plot' data key, like this:

var plot = $("#placeholder").plot(data, options).data("plot");
@dnschnur dnschnur was assigned Feb 9, 2013
@dnschnur dnschnur merged commit 410dd7d into flot:master Feb 9, 2013
@dnschnur dnschnur deleted the dnschnur:jquery-chainable branch Feb 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment