Error static Y axis


« 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 Jesus on 27th November 2012
Hello, the problem is when i use line.Set('tooltips.coords.page', true) or gantt1.Set('chart.events',...), the popup does not display correctly positioned on the screen when we use the scroll, positions it in the part where the chart should be without scroll.

The example:

www.subirimagenes.net/show-image.php?id=afce52badc888168a683b204b2dcf844
Posted by RGraph support on 27th November 2012
Hi,

I can't tell what you're doing - try putting the example page online. And in the case of the Gantt chart you should be giving your events array as part of the constructor.
Posted by RGraph support on 27th November 2012
Hi,

And there's an example here of a Gantt chart with overflow and tooltips:

dev.rgraph.net/tests/gantt/gantt2.html
Posted by Jesus on 27th November 2012
My example online:

aplicacionhitos.16mb.com/diagramagantt2.php


The script code:

     <script>
         window.onload = function ()
         {
             var gantt1 = new RGraph.Gantt('cvs');
             gantt1.Set('chart.xmax', <?php print($numdias) ?>);
             gantt1.Set('chart.labels', [<?php for ($i=1;$i<intval($total/2592000);$i++){?>'<?php echo $i;?>',<?php }?>]);
    gantt1.Set('noxaxis', true);
             gantt1.Set('noyaxis', true);
             gantt1.Set('ylabels', false);
   
    gantt1.Set('chart.events', [
                                         
            <?php
$result = mysql_query("SELECT * FROM Hitos");
           
while ($frow = mysql_fetch_array($result)){
$tdias=(strtotime($frow["fech_ini"])-strtotime($fecha_comienzo));
            $tdias=intval($tdias/86400);
$tdias2=(strtotime($frow["fech_fin"])-strtotime($frow["fech_ini"]));
            $tdias2=intval($tdias2/86400);
?>
[<?php print($tdias) ?>,<?php print($tdias2) ?>,null,'<?php print($frow["nombre_hito"])?>'],
             <?php
]);
          
          
gantt1.Set('chart.tooltips',[
   
<?php
          
$result = mysql_query("SELECT * FROM Hitos");
while ($frow = mysql_fetch_array($result)){
   
                      
  ?>
             "<b><?php print($frow["nombre_hito"])?></b><br />Fecha de Inicio <?php print $frow["fech_ini"];?> hasta <?php print($frow["fech_fin"]);?>",
          <?php
  }
?>
  ]);
             gantt1.Draw();
        
  
         // Get hold of references to the canvas (and its context) that the axes will be drawn on
         var canvas = document.getElementById("axes")
         var context = canvas.getContext('2d');
        
         // A small anti aliasing fix so that the axes that are about to be drawn are sharp - not blurry
         context.translate(0.5,0.5);

         RGraph.Clear(canvas, 'white');
        
         // Finally draw the new Y axis using the RGraph API function
         RGraph.DrawYAxis(line, {
                                 'axis.context': context,
                                 'axis.max': line.max,
                                 'axis.x': line.gutterLeft + 15,
                                 'axis.color': 'black',
                                 'axis.title': 'A static Y axis'
                                });
  
   }
     </script>
Posted by Jesus on 27th November 2012
Found!!,thanks =)

Add a reply

 




« Back to message list
RGraph on social media