Using data Api open flash chart2 show


(svens) #1

How i can use in php5 the api data for a chart with open flash chart2

sry for my english. I will use the data for a Magento Plugin.


(Matthieu Aubry) #2

What do you mean exactly: do you want to generate the data used by the flash file to show graphs? if yes, lookup OFC documentation.
DO you want to load the HTML used to generate Piwik flash graphs ? Check out the “widgets” link at the top that will give you the IFRAME code.

what do you want to do exactly?


(Gingah) #3

Hi,

I realize the post is somewhat old, however I am looking for the same thing that svens was looking for. As simple it is with iframes, they break most web standards, and ruining themselves with badly defined sizes and no support for liquid setups, and in light of these “facts”, I also am trying to find out how you invoke the widgets.

More or less, do you have a simplified way of getting the output of a widget in some other format, such as raw php? I like the way the widgets look, both charts and tables, but I need to output them in a more generic way, so that they are treated as proper elements, and not diminished and ruined by the iframes.

Do you have any suggestions for how to accomplish this?


(vipsoft) #4

If you go to the Widgets screen, you’ll find that some widgets have code to Embed Flash (as an alternative to Embed Iframe).

If you go to the API screen, you’ll find that you can get results back in ‘Basic HTML’ form. It’s not pretty, but it might be a starting point.


(Gingah) #5

I managed to get the raw HTML form working, which is a good starting point indeed. But is there a class in piwik I can call upon them to convert the html tables to charts and graphs?


(vipsoft) #6

You don’t need a class. Look at the Open Flash Chart 2 documentation and use the data-file parameter.

Look at the Embed Flash code for any of Piwik’s Flash-based widgets.


(Gingah) #7

Ended up solving it with enabling scrolling on Iframes, the direct parts for the graphs and charts worked well, but I also wanted the standard tables (in the default Piwik-style) displayed. Would be nice if you added some javascript function for auto-resizing the iframes (in height at least) in the future, rather than using 350px as default.

Other than that, the result looks great style_emoticons/<#EMO_DIR#>/biggrin.gif


(Matthieu Aubry) #8

[quote=Gingah @ Jun 11 2009, 05:17 PM]Ended up solving it with enabling scrolling on Iframes, the direct parts for the graphs and charts worked well, but I also wanted the standard tables (in the default Piwik-style) displayed. Would be nice if you added some javascript function for auto-resizing the iframes (in height at least) in the future, rather than using 350px as default.

Other than that, the result looks great style_emoticons/<#EMO_DIR#>/biggrin.gif[/quote]

feel free to submit a patch to do this, we would love to have this feature