Chart disappears after draw


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by jrosette on 15th October 2012
Hi Support,

I use your librairy to draw multiple chart on the same page.
Charts are drawn well but after clicking on one chart some charts disappear
this the code I used:

<?php
include("functions/variables.php");
include("functions/phprequest.php");
?>
<html>
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <link rel="stylesheet" href="src/RGraph/css/website.css" type="text/css" media="screen" />
         <script src="src/RGraph/libraries/RGraph.common.core.js"></script>
         <script src="src/RGraph/libraries/RGraph.line.js"></script>
         <script src="src/RGraph/libraries/RGraph.common.core.js" ></script>
         <script src="src/RGraph/libraries/RGraph.common.dynamic.js" ></script>
         <script src="src/RGraph/libraries/RGraph.common.tooltips.js" ></script>
         <script src="src/RGraph/libraries/RGraph.common.effects.js" ></script>
         <script src="src/RGraph/libraries/jquery.min.js" ></script>
         <script src="src/RGraph/libraries/RGraph.common.key.js" ></script>
         <title>JSP Page</title>


     </head>

     <body>

<?php
$protoarray = array();

$protoarray = mysql2index($dbserver, $dbuser, $dbpass, $db);

// print_r($protoarray);



for ($i = 0; $i < count($protoarray); $i++) {
    

echo "
             <canvas id='cvs$i' width='600' height='250'>[No canvas support]</canvas>

   
            
        
           

           
             <script>
                 line = new RGraph.Line('cvs$i', ".mysql2json($dbserver, $dbuser, $dbpass, $db, 'Request').",".mysql2json($dbserver, $dbuser, $dbpass, $db, $protoarray[$i]).");
                 line.Set('chart.curvy', true);
                 line.Set('chart.curvy.tickmarks', true);
                 line.Set('chart.curvy.tickmarks.fill', null);
                 line.Set('chart.curvy.tickmarks.stroke', '#aaa');
                 line.Set('chart.curvy.tickmarks.stroke.linewidth', 2);
                 line.Set('chart.curvy.tickmarks.size', 5);
                 line.Set('chart.linewidth', 0.75);
                 line.Set('chart.hmargin', 5);
                 line.Set('chart.labels', ['0000', '0400', '0800', '1200', '1600', '2359']);
                 line.Set('chart.tooltips', ['0000', '0400', '0800', '1200', '1600', '2359']);
                 line.Set('chart.key', ['Request','".$protoarray[$i]."']);
                // line.Set('chart.background.grid.autofit.numvlines', 20);
                 line.Set('chart.key.interactive', true);
          
                 RGraph.Effects.Line.jQuery.Trace(line);
                
             </script>
                       
        ";


    
}
?>
        
     </body>
</html>
Posted by RGraph Support on 16th October 2012
Hi,

I would suggest the following:

o Try minimising the code used to generate the chart. In particular take out the
   Trace effect and the tooltips.
o Try using a Javascript console to see if any error is being logged there.
o Instead of posting the code - post a link to the page in question and I'll have
   a look at it.

Add a reply

 




« Back to message list
RGraph on social media