matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.13k stars 2.57k forks source link

Non-Flash Charting & Tables #804

Closed robocoder closed 13 years ago

robocoder commented 14 years ago

Client-side:

In #760, there is a proof-of-concept example using JavaScript libraries to present a non-Flash line chart and table based on HTML tables retrieved via Piwik's API.

We should flesh this out more as this feature would provide:

Things to consider:

Server-side:

anonymous-matomo-user commented 14 years ago

Attachment: FLOT Graphs patch piwik_html5.patch

anonymous-matomo-user commented 14 years ago

Attachment: Screenshot Piwik_Web Analytics Reports_1265736698765.png

robocoder commented 14 years ago

Interesting excanvas examples by Jon Combe, the author of JAWStats:

mattab commented 14 years ago

if we do something like this, we should consider the following:

mattab commented 14 years ago

note, my previous ticket should really be in a different ticket - but is related to this.

robocoder commented 14 years ago

More links:

robocoder commented 14 years ago

Use swfobject.hasFlashPlayerVersion(versionStr) to detect Flash. Add parameter to server request when loading dashboard, iframe widgets, etc. Piwik_ViewDataTable::factory would generate alternate content if Flash not detected.

robocoder commented 14 years ago

rolling in comments from #545 and #1084

anonymous-matomo-user commented 14 years ago

Other charts with canvas : Flot

Not RGraph because the licence isn't free (not commercial use).

jQuery Visualize Plugin is a very good solution, but they aren't tooltip...

anonymous-matomo-user commented 14 years ago

I have begun adding support for HTML5 graphs created with FLOT. I have the PieChart and VerticalBarGraph working, in a very basic manner. The graphs are not all that pretty at the moment, but that is not a shortcoming with FLOT, merely I have not done any styling.

Also, this is the first time I have ever worked with smarty templating, so any abuse^H^H^H^Hfeedback about how I have implemented it would be greatly appreciated.

mattab commented 14 years ago

lsowen, the work looks interesting. Can you please post screenshots of the rendered graphs?

Do you aim to be included in the Piwik core? if so, all the existing features would need to be covered. Is this possible using this technology?

Alternatively, we could have the HTML5 plotting system in a plugin but this is not currently supported and would need some core modifications.

Cheers

anonymous-matomo-user commented 14 years ago

Matt, I wasn't aware of the HTML5 plugin. I think that FLOT could cover all the needed use cases, at least the ones I am aware of. I am, admittedly, new to Piwik hacking.

I believe that this would be a good thing to include in the core. I am attaching a screenshot.

mattab commented 14 years ago

Does it also handle the hover to show a tooltip? would it be possible to try and emulate as much as possible the current style, colors, thickness of graphs in Piwik? thx

anonymous-matomo-user commented 14 years ago

My next iteration will hopefully match the style of Piwik much better. Yes, tooltips are possible and I plan on implementing them.

A question though, are there any pie, vertical bar, or evolution charts that show more than one data series at a time? I want to ensure to test my HTML5 charts on it.

mattab commented 14 years ago

lsowen, you can check out the ExampleUI plugin that shows graphs with 2 lines. Vertical bar and pie chart have only one data serie though. However, with the upcoming feature of #291 line charts with two series will become very important to support.

anonymous-matomo-user commented 14 years ago

I wanted to post an update of the work I have done. I discovered that while FLOT is full featured and mature, it is somewhat brittle, especially when it comes to non-line charts (eg bar or pie). Changes to how charts are created require changes to the core. Therefore, I went looking for a more flexible and extensible alternative. I found this in jqPlot, which features a cascading plugin system. However, jqPlot is not nearly as mature as FLOT, and is missing several key features such as hover detection and tooltips for pie charts.

I tried to push changes upstream to jqPlot to try to allow these features to be implemented, but so far, the author has not responded.

gka commented 13 years ago

Here is another new non-flash charting library, straight from the stanford universtiy: http://vis.stanford.edu/protovis/. Looks very nice and also allows for more complex charts and animated charts.

robocoder commented 13 years ago

That's sweet, greg. And it's BSD licensed.

On Android, I suppose we'd still use Flash given that SVG is (currently) disabled in their webkit build.

anonymous-matomo-user commented 13 years ago

Is there any update on this ticket? I have recently started using piwik for our small website. I can provide testing help for any changes.

By the way, www.openwebanalytics.com shows graphs using 'canvas' elements. You should probably take a look at their code to see which third party libraries they use.

robocoder commented 13 years ago

No update yet. Usually there will be an associated changeset if there's work on a ticket.

anonymous-matomo-user commented 13 years ago

I tried using the patch here on our website [1]. I needed to do a few changes to the patch. But the graphs don't show up. I always see 'Graph could not render' message.

I am using piwik 1.0. Any idea what could be wrong? I can provide my version of patch if needed.

[1] http://www.gnusim8085.org/piwik/index.php

anonymous-matomo-user commented 13 years ago

Looks like I spoke too early. It is possible that the error I was seeing was due to data not being available. Now I can see bar charts and pie charts in their HTML5 glory.

I will attach the updated patch against 1.0 soon.

anonymous-matomo-user commented 13 years ago

onkarshinde,

This is definitely something I'm still interested in working on. Post your updated patch when you get a chance, and maybe we can get something worked out between the two of us.

mattab commented 13 years ago

Before doing any work on this, please consult #1721 which is pretty related, if not a subset of this ticket.

anonymous-matomo-user commented 13 years ago

Matt,

Looks like it is possible to turn an HTML5 canvas object into a png. My focus at this point will remain on making dynamic, client side rendered charts via HTML5.

Information: http://stackoverflow.com/questions/923885/capture-html-canvas-as-gif-jpg-png-pdf

mattab commented 13 years ago

Any update on the non-flash charting? thanks

robocoder commented 13 years ago

awendt is working on a web-based iPhone UI ( https://github.com/awendt/piwik-iphone ), and he chose Raphaeljs (MIT licensed; renders to canvas). (Looks like he already tried the Filament Group's jquery visualization plugin.)

The demo lacks interaction, but is a capability of Raphaeljs.

http://awendt.github.com/piwik-iphone

It currently doesn't require server mods. But to make this generic, widget-specific helper code should be generated by the server.

mattab commented 13 years ago

No update from developer in 8 months. Work is now covered in following tickets: