flot-orderBars
flot-orderBars copied to clipboard
Minified Version
Is it possible to provide a minified version of the plugin?
Yeah, give me a couple of days and I'll get this done.
No problem, I'll try and help as much as I can. Any idea why this isn't included in the flot repo with all the other plugins? I think we should try and get it in there.
I'm not sure. I only started this repo because I wanted somewhere to share the changes I had made to the original plugin. Originally it was started on a personal website, not in source control so it was hard for people to collaborate. I think there are quite a few versions knocking about and it'd be nice to get a centralized version people can improve so yes - I'm all up for trying to get it in flot.
I also used the original one that you mentioned. Ok, in this case ignore this issue and lets try get it into the main repo.
There are some issues I had with this version of the plugin and IE7. On line 107, there is a .indexOf() which is being called on an Array. IE7+8 have not got this method available only from IE9 is it implemented. I was trying to understand what orderValuesSeen array was used for.
Secondly the from the original repo there is an "interactive" demo using plothover event and tooltips. In my implementation, I got all my different chart types to workexcept for the ones using the flot.orderBars plugin. Again in FF21 it worked and displayed the tooltip where in IE7 it never displayed the tooltip. It basicallboils down to if(item){}else{} and IE seemed to be branching to the else statement
- I had to implement a
orderValuesSeen
array for compatibility with the stacked plugin. Before the change, 2 series that would be stacked on top of one another were both considered to be side-by-side by the plugin. This meant that the gap calculated was for 2 series, when in reality it should only be for 1 (2 series stacked = the width of 1 series). By making sure I only consider each order value once, it means I disregard multiple series with the same order from the width calculation. For regression, multiple series with the same order would be drawn over the top of each other, which still happens. As for the IE7 bug, you're probably right. It could do with changing. Because Flot depends on jQuery, we can just use some jQuery function. I'll make this change soon. - I'd have to see some code to debug this issue properly, but it sounds like another IE7 bug surrounding checking truthy values. If you could show me a breaking example I'll look into it, but it looks like it'd be fixed by changing an
if(item)
into anif(item === null)
.