Forum - jschmidt-systemberatung.de

× php-RGraph and php-rgraph Joomla Content Plugin

Auto Rendering

More
3 years 11 months ago #1201 by jochen
Replied by jochen on topic Auto Rendering
hi,

for that you will have to write an event_script - which may update your chart as req, - also see example;
www.jschmidt-systemberatung.de/index.php...1&Itemid=659&lang=en

Please Log in or Create an account to join the conversation.

  • Tan
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 11 months ago #1202 by Tan
Replied by Tan on topic Auto Rendering
Yes, you are right but I using database table.
I think, maybe  you can develop for used database. This would be a great convenience.  Did you think about?  :)
for e.g: autoRender=1 autoRenderTime=120 

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago #1203 by jochen
Replied by jochen on topic Auto Rendering
hi,
as I told you - you must implement your requirement with an event-script - such a script would first query a database (remote or local) and then update your chart with the new data. An event-script parameter coluld be set  to trigger the time interval for the query or update. This script will have to be developed by you because it is your unique requirement.    

Please Log in or Create an account to join the conversation.

  • Tan
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 11 months ago #1204 by Tan
Replied by Tan on topic Auto Rendering
Dear Master,

I need your  support. I tryed a simple event_script with triggered a button but it's didn't change data. I don't understand where I'm doing wrong.



jQuery(document).ready(function() { jQuery("#growed").click(function(){var data = [1,2,3]; chartcsv_bar2.data=data; chartcsv_bar2.grow();}); var chartcsv_bar2 = new RGraph.Bar( {"chart_type":"Bar","id":"csv_bar2","data":[14,7,1],"options":{"gutterLeft":40,"gutterRight":10,"gutterTop":40,"gutterBottom":120,"colors":["#0052cc","#52CCA3","#996633","#339933","#00BFFF","#66ff33","191970","#FF6600","#e60000","#008000"],"backgroundColor":"rgba(240, 240, 240, 0.4)","colorsSequential":true,"linewidth":1.5,"backgroundGrid":true,"backgroundGridColor":"#000000","scaleDecimals":0,"textAccessible":false,"titleFont":"Arial","titleSize":11,"titleColor":"#555555","textFont":"Arial","textColor":"#555555","textSize":6,"tooltipsCssClass":"rgraph_tooltips","axisColor":"#000000","titleYaxisColor":"#555555","titleXaxisSize":9,"titleYaxisSize":9,"titleXaxisPos":0.3,"titleYaxisPos":0.3,"grouping":"stacked","labelsAbove":true,"labelsAboveSize":7,"labelsAboveDecimals":0,"tooltipsEvent":"onmousemove","variant":"bar","keyBackground":"rgba(145,168,238,0.4)","unitsPost":"psc.","textAngle":45,"variantThreedAngle":0.06,"shadow":true,"bevel":true,"scalePoint":",","scaleThousand":".","labels":["PRICING -> [Registered group\nSTART and send to\nCustomer Representative group]","PRICING -> [Customer Representative group\nACCEPT and send to\nDesign group]","PRICING -> [Registered group\nREROUTE and send to\nCustomer Representative group]"],"strokestyle":"rgba(250,250,250,0.1)","xlabelsOffset":5,"tooltips":["PRICING -> [Registered group\nSTART and send to\nCustomer Representative group]<br>14 pcs.\/ Total 22 pcs.","PRICING -> [Customer Representative group\nACCEPT and send to\nDesign group]<br>7 pcs.\/ Total 22 pcs.","PRICING -> [Registered group\nREROUTE and send to\nCustomer Representative group]<br>1 pcs.\/ Total 22 pcs."]}} ).grow();
});

Please Log in or Create an account to join the conversation.

More
3 years 11 months ago - 3 years 11 months ago #1205 by jochen
Replied by jochen on topic Auto Rendering
hi,
you will need plugin parms with parmeter event_script pointing to a script file containing event-script like this 
window.addEventListener("message",function(e)          {var chart.data=(Array(e.data));          chart.redraw(); },          false);

a second (standalone) script would get the data and issue a post to trigger event-script ,,,:postMessage(yourdata,"*")... Eventscript would then do the update of data and redraw chart. 

so you have plugin parms:
{rgraph chart_name="chart" event_script="your-scriptfile" ...}cvs{/rgraph}

and your "data-Script" (e.g.) within your article.
   
Last edit: 3 years 11 months ago by jochen.

Please Log in or Create an account to join the conversation.

  • Tan
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
3 years 10 months ago #1206 by Tan
Replied by Tan on topic Auto Rendering
Hi Joachim

Not working. I know, this is only javascript issue but I feel like an idiot. I trying with simple setted values but  chart refreshes with the first values. :(
I know I was so tired of you. I am so sorry.


event_script:
var worker=new Worker("/plugins/content/rgraph/js/tan-event-js/event-script-1-worker.js"); worker.addEventListener("message",function(e){ console.log(Array(e.data)); chart.data=Array(e.data); chart.grow();},false);

standalone script: 
var delay=5000;function Update(){var pass_data = '11,15,20'; postMessage(pass_data);setTimeout(Update,delay);}setTimeout(Update,5000);

Please Log in or Create an account to join the conversation.

Time to create page: 0.145 seconds
Powered by Kunena Forum
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.