-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageGraph: export reports as graph #1721
Comments
Attachment: plugin source including pChart framework |
Attachment: Example of continent report drawn as bar graph |
Attachment: Example of continent report drawn as line graph |
Attachment: Example of coutry report drawn as 3d pie graph |
Attachment: Example of OS report drawn as 3d pie graph |
Attachment: Example of visitsperlocaltime report drawn as bar graph |
arni: very nice. This is a great start to generating graphs on the server side. Other use cases include:
|
Attachment: |
On some php installations the pChart Framework throws an Error, while ErrorReporting is set to "GD". For first fix, I set the ErrorReporting of pChart to off. See the new API.php at Line 117 |
update: You can now set the column of report which is used as ordinate |
Attachment: New Source of ImageGraph including pCart-Framwork |
I tried to get ImageGraph to work but failed. Can you provide a few more examples of which reports work? Not just the PNG but the URL you use to generate the image? I tried clicking on the example URL Piwik generates, got an error "uninitialized string offset 0/1 in pChart/pData.class", see Then I tried to get a simple line chart for unique visitors in last 30 days, got another error "undefined index dimension/processedMetrics in API.php", see To get the public URLs to work, I commented out Piwik::checkUserIsNotAnonymous() and Piwik::checkUserHasViewAccess($idSite) in API.php - is that a security risk? (my data is all public anyway, I just don't want the server to be hijacked :-)) My goal is the line chart for unique visitors in last 30 days. But I'm a little lost in the various tables, metadata, etc. Any help or more documentation for ImageGraph (example URLs) is very appreciated. |
Replying to wolfgang:
The ImageGraph should work with all reports, providing the
Im not sure, why this is not working on your copy.
This will not work, because the VisitsSummary.get doesnt provide the
Im not very familiar with piwik, too.
To get a report for the unique visitor of the last days, that could be drawn by the ImageGraph-Module you will need another plugin, which I will publish in the next few days. Some links that should work: index.php?module=API&method=ImageGraph.get&idSite=1&period=day&date=yesterday&apiModule=UserCountry&apiAction=getCountry&format=xml&token_auth= index.php?module=API&method=ImageGraph.get&idSite=1&period=day&date=yesterday&apiModule=UserCountry&apiAction=getContinent&format=xml&token_auth= index.php?module=API&method=ImageGraph.get&idSite=1&period=week&date=yesterday&apiModule=UserSettings&apiAction=getOS&format=xml&token_auth=
|
(same wolfgang, forgot password and password reminder emails are not being sent out...) Thanks for your help!
That is pretty much exactly the link I posted as not working, and if you would have clicked on it you would see the entire (long) error which I didn't want to paste here because you just need to click on it to see it.
Piwik 1.0, php 5.3.2
Oh great, I will be very much looking forward to it. When I find some time, I will dig deeper into my actual bug, which as I say is still there...
No they don't work. All 3 of them don't work. That is the bug I was trying to tell you about. You can click on my link then you see it. I will try to dig deeper if I can. Thanks a lot for your help, good luck with this plugin and the new one, I think it's really cool! |
Hi Wolfgang. Ive clicked on your posted links, but I cant reproduce them on my system. Thanks arni Replying to wolfgang2:
|
Attachment: Fixed Code in included pChart - Framework |
wow, yes! I looked at what you changed and would not have thought that it makes a difference, but the country chart works now! (you can click on the old link) Strange though, in pChart.class, you change a $this->Data to $this->data (lower-case), even though everywhere else it's always upper-cased. It looks like you introduce a bug but you fix it... Maybe there are both a lower-case and upper-case data/Data somewhere? Anyway, you know what you are doing. Country graph is working for me now, and I am eagerly awaiting the one you mentioned that could display unique visitors. |
Hi Wolfgang. You can check now the ticket #1773 to install the VisitsSummaryEvolution plugin. index.php?module=API&method=ImageGraph.get&idSite=1&period=month&date=yesterday&apiModule=VisitsSummaryEvolution&apiAction=getVisitsSummaryDailyEvolution You should receive a line chart displaying the visitors of each day for the current month. arni Replying to wolfgang2:
|
arni, are you interested to get this code contributed to core? I would like to do a full code review, if you confirm that you are ready for it, I'll get started :) It looks like a great start! |
Yeah. Of course. Replying to matt:
|
The pChart library contains Microsoft fonts (i.e., tahoma.ttf in pChart 1.27d and verdana.ttf in pChart 2) that don't allow for this form of redistribution. The font should be removed from the package. (The user can be instructed to install the missing font, if required.) |
Is anyone still working on this plugin? |
I will move all fonts out, except of GeoSansLight. This should be ok. or am I wrong?! Replying to vipsoft:
|
Im on. Just a bit busy at this time. Replying to SteveG:
|
If labels are translated, what's the coverage wrt Piwik translations? Is there a fallback to English? |
Replying to vipsoft:
I do not really understand your answer. |
vipsoft, the ImageGraph plugin is using the Metadata API so it doesn't deal with any translation it is all automatic arni, I have sent you an email for discussing future of the plugin and how we can integrate it |
Sorry, I was posting from my iPhone. I'll try to be clearer. Since ImageGraph doesn't deal with translations directly, then there's no fallback to English if characters used by a (translated) label can't be rendered using the available font(s). For example, GeoSansLight appears to be limited to Latin-1 characters (accented characters) and some special symbols (e.g., Euro). It would not be able to render the translated labels for Amharic, Arabic, Belarusian, Bulgarian, Hellenic, Hebrew, Japanese, Georgian, Korean, Russian, Telugu, Thai, Ukranian, or Chinese. |
WRT maintenance of third-party libraries:
|
I have suggested to Arni the following features:
one update
Arni confirmed he is interested in finishing the work so this is great news!! then we shall modify PDF reports and of course, Piwik Mobile :) |
(In [5582]) * fixes #2706, #2828, #2704, refs #1721, #2637, #2711, #2318, #71 : horizontal static graph implemented
|
(In [5596]) refs #1721
|
(In [5597]) refs #1721
|
(In [5601]) refs #1721
|
(In [5634]) refs #1721
|
(In [6112]) refs #1721 - wrong package in php doc |
(In [7081]) refs #1721
|
(In [7139]) refs #1721 increase max width & height for tablet screens |
See http://piwik.org/docs/analytics-api/metadata/#toc-static-image-graphs
This plugin renders graphs from piwik reports.
Every report with existing columns 'label' and 'nb_visits' is applicable, at this time.
The
label
values are taken for the abscissa and 'nb_visists' values are drawn as value.Such reports could be drawn as :
a. basic line
b. basic bar
c. 3d pie
The pChart Framework (http://pchart.sourceforge.net/) is used to render graphs as png.
The text was updated successfully, but these errors were encountered: