Draw own JS charts?


#1

Hello,

Can someone tell me, if it is possible to create the js charts via PHP directly?
Normally i create a chart like this:


$v = Piwik_ViewDataTable::factory('graphEvolution');

and then fill it with data:


$v->init(pluginName, __FUNCTION__, 'PluginName.getFanEvolution');

But in this way the api (getFanEvolution) and controller functions have to be implemented for each graph static. But I want to create charts dynamic, based on a config file. Can someone give me a hint?

Greets

manuel


#2

:slight_smile: Oookay and how does it work?


(Matthieu Aubry) #3

Take a look at the plugin “ExampleUI” which shows how to use graphs in Piwik


#4

I know the ExampleUI plugin and for every chart you want to draw you need an own function. For example you need the function echoEvolutionGraph() to draw an evolution graph. But what if I want to draw 20 charts based on different data sources in the api? Or I want to change the graph type for every chart based on a config file and I dont want to implement this directly in every function?

manuel


(Matthieu Aubry) #5

you can then use parameters to customize the graphs?