Repository navigation
Conversation
to jquery.flot.js that is executed after the legend is inserted into the DOM.
|
I have problems getting this to work with more than one graph on the page. The problem is that the toggling only works on one graph. The graphs are created dynamically and only the last graph has the toggle functionality. |
|
Thanks, I'll look at it and fix the issue. Fixed: jamesinc@753bd2f |
…gends. Updated the example file to demonstrate multi-chart capability.
|
Yep, it works now. Sweet, I've been looking for just something like this. |
|
At the moment no (I think), because the chart doesn't get completely torn down and re-drawn from scratch. I'll have a look though. |
|
awesome. just what I need! i had been implementing this based on flot/examples/turning-series.html but using a legend labelFormatter that created checkboxes with onclick handlers to modify the series and replot, but then i noticed of course that flot removes the entry from the legend too, making me unable to toggle it on again. your solution is better, i hope it gets merged. but +1 on adjusting the scale. |
|
There are 3 small problems that I noticed with the latest commit. a) jQuery (at least on version jquery-1.7.1.min) messes up the iteration over entries (it finds a .each propery and calls setupSwatch() on that). Should user for(;;) loop instead. Other than those 3 things, this plugin worked perfectly. |
|
hey @jamesinc any updates? thanks! |
|
Thanks for the plugin, this is very useful and working perfectly. Thanks Jamesinc. Could you please suggest what sI am making a small enhancement to the demo file togglelegend.html to make the graph as dynamic by calling the same code with setinterval() within a function drawgraph(). The flot is hiding the series only for that instance of call and then while redrawing next time the series was showing without hiding. Here is the code with my changes: <title>Flot Examples</title> <script language="javascript" type="text/javascript" src="../jquery.js"></script> <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script> <script language="javascript" type="text/javascript" src="../jquery.flot.stack.js"></script> <script language="javascript" type="text/javascript" src="../jquery.flot.togglelegend.js"></script> |
|
Sorry, the format of the code file got messed up. Here attaching the file. |
|
hey @jamesinc any suggestions on this? thanks! |
|
Hi, |
|
Hey guys, sorry I have been away for a couple of weeks! I will go through all your feedback now. Thanks for taking the time! |
|
Hi James welcome back. I sent the code in previous messages, if you want I can send it back. Really appreicate your input on this. |
Conflicts: examples/pie.html jquery.flot.pie.js
|
@itdevelopr I didn't get your code. Could you possibly put it up as a jsFiddle, or even just e-mail it to me? [email protected] |
|
@JeremySimpson could you give me a little more info on point (a), above?
Edit: Never mind, I figured out what you are referring to. Derp. |
$.plot. This is achieved by adding a jQuery data object to the placeholder element.
|
@itdevelopr The latest has a draft of this functionality. Implementation aside, I should probably add an option to turn the feature on/off. |
Fix JSCS task
Move JS files under src directory
Lowercase name in package.json
- Fix JSDoc headers where applicable - Add spacing before/after comments per jQuery style guide
jQuery removed $.support.leadingWhitespace from jquery greater 2.0 because support was dropped for IE 7/8. So if property is undefined, we are pretty shure its ie > 8 or jQuery does not support the browser anyway.
Fix browser detection for jQuery > 2.0
Pan trigger extended to contain information if the dragging has ended or not
Old version had a hard peerDependency that caused npm install to fail during CI. The lastest uses a more flexible version mapping.
Add spacing to comments in jquery.flot.js
Conflicts: NEWS.md component.json flot.jquery.json jquery.flot.canvas.js jquery.flot.fillbetween.js jquery.flot.pie.js jquery.flot.time.js package.json src/jquery.flot.js src/plugins/jquery.flot.crosshair.js src/plugins/jquery.flot.navigate.js src/plugins/jquery.flot.resize.js
Removing appending warning to dom
|
This is an awesome plugin. Can it get added to the official project? Looks like it failed. |
The plugin example for toggleLegend has been updated to align better with Flot's examples structure.
|
@codeBelt the plugin is not the cause of the Travis CI build errors. If you check Travis you'll see the master branch of flot is also failing. The passing branch is their 0.9-work branch. In any case, the build failures are due to a bad build config. If you want to use the plugin it will work just fine. |
|
What about resizing the axes to match only the checked/visible items? Currently it only hides them, but it's useless since it won't rescale to the remaining items. |
This is a simple flot plugin to allow series to be toggled on or off by clicking on their colour boxes in the chart legend. A demo file has been added to examples/
It also adds a new hook, legendInserted, that the plugin uses to determine when to reinitialise itself.