Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

RGraph library

Post Reply
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

RGraph library

Unread post by ruiascensao »

Hi,

Could you please provide more information on how to use this library in nuBuilderPro?

Thank you.
BR
Rui
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: RGraph library

Unread post by ruiascensao »

Hi,

Could you please provide an example?

Thank you.
BR
Rui
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: RGraph library

Unread post by admin »

Rui,

We actually use google charts now. Here's how..


1.Create a php snippet.
1.PNG
(sample code below)

Code: Select all


ob_start();


$gg = "

<html>
  <head>
    <script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
      google.load('visualization', '1', {packages:['corechart']});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Hours per Day'],
          ['Work',     11],
          ['Eat',      2],
          ['Commute',  2],
          ['Watch TV', 2],
          ['Sleep',    7]
        ]);

        var options = {
          title: 'My Daily Activities'
        };

        var chart = new google.visualization.PieChart(document.getElementById('piechart'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id='piechart' style='width: 400px; height: 400px;'></div>
  </body>
</html>

";


ob_end_clean();
echo $gg;
2.Create an Iframe object.
2.PNG
3.PNG
Steven
You do not have the required permissions to view the files attached to this post.
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: RGraph library

Unread post by ruiascensao »

Hi Steven,

Thank you for your help!
BR
Rui
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: RGraph library

Unread post by admin »

.
Post Reply