Multi data bar chart


(sivakumar) #1

Hi,
I am building my own plugin, for which i have to show a widget.

I have to show a bar chart like
Open Flash Chart - Gallery - Bar Chart 2

So can you please help on how to pass data to datatable object, so that the above is achieved

thanks


(sivakumar) #2

any help???


(sivakumar) #3

any suggestion please


(sivakumar) #4

hi,

Some small hint will help me to find solution.

Is the bar chart build dynamically?


(sivakumar) #5

style_emoticons/<#EMO_DIR#>/unsure.gif style_emoticons/<#EMO_DIR#>/ohmy.gif It’s my fourth reply…
Still i yet to get a reply.

Will the feature comes in future?

Is there any workaround to achieve it?


(vipsoft) #6

It is supported by Open Flash Chart, but not by Piwik’s Visualization code.

Please take a look at core/Visualization/Chart/Evolution.php to see how multiple lines are supported in the evolution chart. Then make similar changes to core/Visualization/Chart/VerticalBar.php and send us a patch. Thanks.


(sivakumar) #7

Hi vipsoft,

Thanks for the update.
I just found , Piwik itself supports this feature.

In dashboard plugin, in API.php

In get function
$dataTable=new Piwik_DataTable();

the $dataTable is used to build the chart.

row to the datatable is added like,

$a1=array(array(‘label’ => $ct[‘date2’],‘Testing1’ => $ct[‘value’]));
$row1=new Piwik_DataTable_Row($a1);
$dataTable->addRow($row1);

So to add multiple line chart then do it like,

$a1=array(array(‘label’ => $ct[‘date2’],‘Testing1’ => $ct[‘value’],‘Testing2’ => $val));

That’s it…
Please make use of these feature.

style_emoticons/<#EMO_DIR#>/rolleyes.gif


(Matthieu Aubry) #8

you can enable, in the plugins tab, the " ExampleUI" plugin. This might help you get your feature done. We can accept patches if they fit well in the existing code base.