Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/11/2011, 15:45
axel07_89
 
Fecha de Ingreso: julio-2011
Mensajes: 17
Antigüedad: 12 años, 9 meses
Puntos: 1
Pregunta Centrar sólo una de dos líneas de gráfico jpGraph

Hola, se que con $p1->SetCenter(); puedo centrar la linea de un gráfico, pero con que aparezca una vez para las demas lo aplica, he intentado con: $p2->SetCenter('false'); pero no funciona, entonces; se podrá centrar una línea solamente del siguiente código:

Código PHP:
<?php
    
    
require_once ('jpgraph/jpgraph.php');
    require_once (
'jpgraph/jpgraph_line.php');

    
$datay1 = array(20,7,16,35);
    
$datay2 = array(6,20,15,22);

    
// Setup the graph
    
$graph = new Graph(350,230);
    
$graph->SetScale("textlin");

    
$graph->title->Set('Background Image');
    
$graph->SetBox(false);

    
$graph->yaxis->HideZeroLabel();
    
$graph->yaxis->HideLine(false);
    
$graph->yaxis->HideTicks(false,false);

    
$graph->xaxis->SetTickLabels(array('En','Fb','Ma','Ab'));
    
$graph->ygrid->SetFill(false);

    
$p1 = new LinePlot($datay1);
    
$p1->SetColor("#55bbdd");
    
$p1->mark->SetType(MARK_DIAMOND,'',1.0);
    
$p1->mark->SetColor('#55bbdd');
    
$p1->mark->SetFillColor('#55bbdd');
    
$p1->SetCenter();
    
$graph->Add($p1);

    
$p2 = new LinePlot($datay2);
    
$p2->SetStepStyle(); 
    
$p2->SetStyle('dashed');
    
$p2->SetColor('red');
    
$p2->mark->SetColor('#aaaaaa');
    
$p2->mark->SetFillColor('#aaaaaa');
    
$p2->value->SetMargin(14);
    
//$p2->SetCenter('false');//que aparezca normal esta
    
$graph->Add($p2);

    
// Output line
    
$graph->Stroke();

?>
Gracias por su ayuda...