VisualAppeal / Matomo-PHP-API

PHP wrapper for the Matomo API.
MIT License
95 stars 33 forks source link

How to use getImageGraph #46

Closed Romaixn closed 4 years ago

Romaixn commented 4 years ago

Hey, I see there is a function called getImageGraph which return a png report.

But what is $apiModule and $apiAction ? Are there any documentation for this ?

Thanks for this package !

thelfensdrfer commented 4 years ago

Hi, I am afraid I do not know the details of many methods myself. I just copied them from the original documentation where I hope you can find more details.

Documentation: https://developer.matomo.org/api-reference/reporting-api (Just search for Module ImageGraph)

This is a working example call with all parameters: https://demo.matomo.org/?module=API&method=ImageGraph.get&idSite=62&period=day&date=today&apiModule=UserCountry&apiAction=getCountry&outputType=0&showLegend=1&fontSize=9&aliasedGraph=1&textColor=222222&backgroundColor=FFFFFF&gridColor=CCCCCC&legendAppendMetric=1&format=JSON&token_auth=anonymous

Does this help?

Romaixn commented 4 years ago

Hey ! Thanks for your help, finally it's work well with you're package but the format should be another to FORMAT_JSON

thelfensdrfer commented 4 years ago

That totally makes sense now. The response will be json encoded otherwise. I will leave the issue open for now and will check if I can fix it.

thelfensdrfer commented 4 years ago

Took a while @Romaixn but is now online in version 1.6.1!

Romaixn commented 4 years ago

Awesome 🎉