Suggested library: jqplot (http://www.jqplot.com)
Here's a first proof of concept implementation.
In your config.ini, add
[General] use_js_charts = 1
Apply the diff and place the contents of jqplot-src.zip in
Sorry for adding the diff as a zip, trac wouldn't accept it otherwise
No worries. It's the spam filter at work.
Looking at the patch:
Otherwise I don't see a blocker for commiting to trunk.
Oh, I see "Export as Image" isn't implemented yet.
Currently, if you click on a sparkline, it will refresh the Evolution graph at the top of the page with the metric clicked on. Is this also working with JS charts?
I'm thinking that it will be easier also to add a list of metrics on the right of the graph, to select which metric to plot (#1820) once we use JS and not flash :)
Thanks for pointing that out, matt.
I have thought of that and in the current version on my local machine (which I will commit soon), clicking the sparklines works. It would be easy to implement a jquery event that can be triggered on the container and receives a data url which will be plotted. That could be used in a select element...
Cool! Instead of a SELECT, I was thinking more of a showing the list of all metrics a bit like google adsense graphs: http://2.bp.blogspot.com/_YbURk67VlGk/TUdM5dkPLVI/AAAAAAAABWU/sDd80kcjJWA/s1600/%25233Graphs_EN.PNG
We could use a Radio button instead of checkbox to keep things simple (click on checkbox would refresh the line)
(In ) refs #2431 LEGALNOTICE, Export as Image translated, removed some unneeded JS
(In ) refs #2431 new legend renderers: nicer for line chart, available for bar chart, inside pie chart. also fixes image export problems.
(In ) refs #2431 show loading feedback when clicking on sparklines
(In ) refs #2431 memory leak fixes (temporarily removed jqplot due to problems with svn)
(In ) Refs #2431 - Alerting "please upgrade your browser" when click on export as image not supported
OK great improvements... I looked at our earlier discussions and all is now implemented and looking great!! :)
I think the last UI "regression" is:
I still have a bit of feedback on leaks (sorry!):
and I think the last task is...
About the tooltip leaks: I did lots of tests and came to the conlusion, that there are no major leaks we can fix anymore. The problem is much worse if Firebug is enable, so make sure it's not.
Here's some more info:
Before the leak fixes, you could up the mem usage as much as you wanted, now it at least has reasonable upper bounds.
About IE: excanvas uses a lot of CPU, but I can't influence that either. It is very memory efficient though, because the canvases can be properly destroyed. If it's slow in IE8, it might show people how crappy that browser is and maybe they update to IE9, which works perfectly fine (and has a way better canvas imlementation than Firefox).
Over the course of the jqplot integration I realized that the canvas technology is still at it's very beginning. Maybe we are a few months ahead of our time, but I think it's a good thing to propagate new technology and maybe help users see how outdated their browsers are. There are modern browsers, why not use them?
If there is a good reason to continue using old browsers, everything works fine, it might just be a little slow (which Flash was as well).
There are some more things on my to do list:
re tooltip/hover leak. Read some posts that suggest using a timer to blur focus of the canvas element periodically (eg every 200 ms) to trigger Firefox's garbage collector.
re: conditional include, see plugins/CoreHome/templates/header.tpl
re tooltip/hover leak: Can you share the posts?
I doubt the problem are still the canvases. They are properly reused (which is what my fix is all about).
For testing I disabled the tooltip and the color changes. The memory still grows. I think, it's just the enourmouse amounts of mousemove events...
To illustrate how crappy Firefoxes memory management is: Try refreshing the page a couple of times...
(In ) refs #2431 excanvas is only loaded in old internet explorers. also minified excanvas.
(In ) refs #2431 removed unneeded jqplot files. reduced jqplot css size. cursor pointer for clickable evolution charts. small sparkline bugfix.
The pie chart bug has been reported to Chris. He will fix it.
Apart from that, everything should finally be done now!
As I said, there still are memory problems in Firefox which I think we won't be able to fix. Are we comfortable with removing OFC from trunk at this stage or should we keep it until Firefox improves its canvas implementation (or we realize that it is our fault after all)?
Export as image has to disabled for IE7 & 8, becuase excanvas does not support that. Later, we can replace that with the ImageGraph library.
We could, but really low priority. IE7/8 can die ;)
There is a little bug on the overview pages with sparklines: If you open an empty report, you can't switch anymore.
OK not a problem
Are we comfortable with removing OFC from trunk at this stage or should we keep it until Firefox improves its canvas implementation (or we realize that it is our fault after all)?
Yes I think now, considering how well this is behaving in Chrome and Safari, the issue really is with firefox.
Please, you can remove all OFC code js/tpl/swf/php code from the trunk :)
wow this is so nice that you did push the feature up to completion to this quality standards!
(In ) refs #2431 ofc removed. perfomance improvements. request size optimizations. general refactorings.
(In ) Refs #2431 removing "flash export" on Widgets Screen, which feels good!
Ticket now fixed, just waiting for jqplot to fix the 100% pie bug but on the piwik, 100% complete and working.
Timo, amazing work from start to finish of this project! Kuddos...
Graphs don't work in French, Italiano, etc. probably a simple encoding issue
(In ) Refs #2431 jqplot update
(sorry, forgot Refs in my original commit message)