• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

Fabrik and Plotalot with variables

Status
Not open for further replies.

susannanam

Member
hello all,

i hope there is someone who uses Plotalot who can assist me... i have an article with a form (fabrik) with some dropdown fields and below a chart from plotalot. i added a php plugin to the form in order to adjust the chart with the selected variables.

in the plugin i have:
Code:
$year ='{mac9k_filters___school_year_raw}';
{plotalot id="31" P1="$year"};

in the chart itself, i have added the variable with a default value (it shows initially, so i assume that is correct)

i have tried a few things but i dont get it right... does someone have a hint please?
thanks
susanne
 
I?m currently using plotalot ... a lot!!! LOL, please add some screenshots to understand better what you want to do. I?m no sure if I can help, but I?ll try.

Have you tried to do the same using a form linked from a menu item instead of using fabrik?s plugin content. also, there?s some things related to the way in wich are you rendering the plotalot chart.

If you are using php plugin to write some variables, in which moment thoose variable are being written?
 
Last edited:
I?m currently using plotalot ... a lot!!! LOL, please add some screenshots to understand better what you want to do. I?m no sure if I can help, but I?ll try.

Have you tried to do the same using a form linked from a menu item instead of using fabrik?s plugin content. also, there?s some things related to the way in wich are you rendering the plotalot chart.

If you are using php plugin to write some variables, in which moment thoose variable are being written?
hi :) great!!!

maybe i am doing it the wrong way, so please advise how it is done best :) here is what i am currently doing: the menue opens an article where i have a form and below the various charts:

{fabrik view=form id=79}


{plotalot id="31"} {plotalot id="32"}

{plotalot id="33"}


the form itself looks like this:
filters.PNG

so when i click on filters, i would like to stay in the same form/article but have the filters applied (do i maybe need to refresh the article somehow?)

here is part of my sql for the chart:
"select 'Feed all ',count(school_id) from xxxxx_trimform where school_year=%%P1=2016%% and"

the php plugin i use in the form is currently onBeforeProcess but i have also tried the "After" already and no change.. as shown in my previous post, there i basically have the call for the plotalot with the variable. somewhere i must be missing something :(

what do you think zzzz54?
 
Last edited:
hi :) great!!!

maybe i am doing it the wrong way, so please advise how it is done best :) here is what i am currently doing: the menue opens an article where i have a form and below the various charts:

{fabrik view=form id=79}


{plotalot id="31"} {plotalot id="32"}

{plotalot id="33"}


the form itself looks like this:
View attachment 14365

so when i click on filters, i would like to stay in the same form/article but have the filters applied (do i maybe need to refresh the article somehow?)

here is part of my sql for the chart:
"select 'Feed all ',count(school_id) from xxxxx_trimform where school_year=%%P1=2016%% and"

the php plugin i use in the form is currently onBeforeProcess but i have also tried the "After" already and no change.. as shown in my previous post, there i basically have the call for the plotalot with the variable. somewhere i must be missing something :(

what do you think zzzz54?
Maybe the best way to try isn?t using php plugin, because the data only are writen when you save the record. at this point I?m thinking that your best shot could be using the calc element. in example:

img
 
Last edited:
Maybe the best way to try isn?t using php plugin, because the data only are writen when you save the record. at this point I?m thinking that your best shot could be using the calc element. in example:

img
hm i am not quite sure if i understand you properly... where would the chart then be called? you have the dropdown in the observed fields. where do you have the call for plotalot?
 
You have to create a new element (calc) where will be rendered the chart. Also you have to take a look in the form options process joomla plugins- detail and form view


ZTLYEa1.jpg}

also in the list you have to go details and then "advanced" tab (process joomla plugins to yes)

img


then, in the new cal element, something like this
img


will render

img
 
Last edited:
You have to create a new element (calc) where will be rendered the chart. Also you have to take a look in the form options process joomla plugins- detail and form view


ZTLYEa1.jpg}

also in the list you have to go details and then "advanced" tab (process joomla plugins to yes)

img


then, in the new cal element, something like this
img


will render

img
thanks zzzz54, i am almost there... got the calc field and it shows the graph :) it also observes the dropdown field and reacts but once i chose anything with the dropdown field, i only see this instead of the graph: {plotalot id="31"} (i took away the variable to make sure, this is not the problem). do you have an idea what i am still missing please?
 
take a look on the plotalot site, they have updated the plugin recently. Which version are you using right now?
 
So you are using "AJAX calc", so it recalcs when you change the dropdown?

Unfortunately, that won't get run through the code that runs the J! content plugins. That only gets run when the main form view is displayed, i.e. when the page is loaded. The AJAX calc doesn't go through the main form view, it runs a method from the calc element itself, which just outputs the literal text you generate in your calc.

What you could try doing is running your text through our helper function that does the content plugin prep, so instead of ...

Code:
return '{plotalot id="31"}';

... do ...

Code:
return FabrikHelperHTML::runContentPlugins('{plotalot id="31"}');

-- hugh
 
So you are using "AJAX calc", so it recalcs when you change the dropdown?

Unfortunately, that won't get run through the code that runs the J! content plugins. That only gets run when the main form view is displayed, i.e. when the page is loaded. The AJAX calc doesn't go through the main form view, it runs a method from the calc element itself, which just outputs the literal text you generate in your calc.

What you could try doing is running your text through our helper function that does the content plugin prep, so instead of ...

Code:
return '{plotalot id="31"}';

... do ...

Code:
return FabrikHelperHTML::runContentPlugins('{plotalot id="31"}');

-- hugh
Hi Hugh, I?ve tried with your suggestion (and so many variations) and the fabrikhelper doesn?t render the plotalot?s plugin.

I?m thinking that something is happening with the " symbol.

also, when I?ve used
Code:
return FabrikHelperHTML::runContentPlugins('{plotalot id="31"}');
it shows a blank page.

removing the ' ' like this
Code:
return FabrikHelperHTML::runContentPlugins({plotalot id="31"});

load the form but the plugin still not working

I?ve tried also:

Code:
$text = '{mydatabase___fieldchart}';

FabrikHelperHTML::runContentPlugins($text);

return $text;

Where fieldchart is a calc element wich i?m using to render and save the {plotalot id="31"} in differents ways just to test. Same result.
 
i'm stucked too. :(

Enviado desde mi SM-G531H mediante Tapatalk

hmm...you said you are using it a lot, the plotalot plugin for similar scenarios. how do you solve it? how does it work on your side? i have no problems to start from scratch and make another approach to get it up and running :) how do you use plotalot with variables (coming from fabrik) please?
 
just for clarification; i've used the plotalot's plugin but not in a scenario like this.however i'm very interested and i've tried so many things. at this point i'm thinking that the problem is related to the doubble colons " inside the plotalot tag. also i've readed the new plotalot documentation and i think that is possibly to pass params to the plugin without problem, but the first step is find the apropiate sintax to load-render the plugin successfully inside the form.



Enviado desde mi SM-G531H mediante Tapatalk
 
Last edited:
oh ok :) so one way might be the calc element but maybe i can also try again with the php plugin? we are stuck at the same point at the moment and look for the right way ;) it is indeed possible to pass parameters and we just have to find the right way with fabrik. maybe more here have tried that already?? anyone who succeeded yet? :) would be great if we can combine those two fantastic extensions :)
 
Ah, my bad. I forgot that helper passes the arg by reference and modifies it, rather than passing by vaue and returning a value. So you'll have to do something like ...

Code:
$myString = '{plotalot id="31"}';
FabrikHelperHTML::runContentPlugins($myString);
return $myString;
 
thanks Hugh, we are getting closer :) the chart is now visible (in case "Calc on load" is off) until i change the dropdown, then the page is still visible (not blank as before) but the chart is gone. i keep on experimenting...
 
thanks Hugh, we are getting closer :) the chart is now visible (in case "Calc on load" is off) until i change the dropdown, then the page is still visible (not blank as before) but the chart is gone. i keep on experimenting...
The plugin render the plotalot "single item fields" correctly. The helper works fine, I can confirm that is possible to pass the id value of the chart using place holders.

i?m using dropdown element and a ccd element populated with the id of the dropdown and this value are being used in the place holder. I?ve do it by this way because the helper is getting the label value instead of the raw value. So, doing this i could see the dropdown readable value and pass the id to the ccd to fill the placeholder correctly.

I?ve tried with another chart like, bars, bubbles, etc with no joy. It only shows the error msg when the charts have no data to show.

Another thing that I?ve tried, is to change the plugins order (fabrik content and plotalot) with no result.

// workaround: the proccess of choose one chart from and dropdown and show the chart after that is possibly by using a list with the filter setup to mandatory, but in this approach you will don?t have the ajax functionality and the possibility of show several charts in one page populated with data dinamicaly.
 
Last edited:
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top