Foros del Web » Programando para Internet » PHP »

Error JPGRAPH bien en local, mal en Internet

Estas en el tema de Error JPGRAPH bien en local, mal en Internet en el foro de PHP en Foros del Web. Hola a todos, estoy usando JPGRAPH para generar graficos de barras para una encuesta. Trabajando en local me funciona perfectamente. Pero probe en Internet y ...
  #1 (permalink)  
Antiguo 16/04/2010, 18:23
Avatar de richicasas  
Fecha de Ingreso: abril-2007
Ubicación: Colombia
Mensajes: 692
Antigüedad: 17 años
Puntos: 13
Exclamación Error JPGRAPH bien en local, mal en Internet

Hola a todos, estoy usando JPGRAPH para generar graficos de barras para una encuesta. Trabajando en local me funciona perfectamente. Pero probe en Internet y me salta un error:
Font file "/usr/share/fonts/trueType/verdanab.ttf" is not readable or does not exit

El codigo que imprime la grafica es el siguiente:
Código PHP:

<?php
include ("includes/jpgraph.php");
include (
"includes/jpgraph_pie.php");
include (
"includes/jpgraph_pie3d.php");
require_once (
'includes/jpgraph_bar.php');


$datay=array(0.13,0.25,0.21,0.35,0.31,0.06);
$datax=array("January","February","March","April","May","June");
// Setup the graph.
$graphname="graph.png";


$graph = new Graph(400,400);
$graph->img->SetMargin(60,60,35,60);
$graph->SetScale("textlin");
$graph->SetMarginColor("lightblue:1.1");
$graph->SetShadow();


// Set up the title for the graph
$graph->title->Set($nombre);
$graph->title->SetMargin(15);
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
$graph->title->SetColor("darkred");

// Setup font for axis
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->yaxis->SetFont(FF_VERDANA,FS_NORMAL,10);

// Show 0 label on Y-axis (default is not to show)
$graph->yscale->ticks->SupressZeroLabel(false);

// Setup X-axis labels
$graph->xaxis->SetTickLabels($datay);
$graph->xaxis->SetLabelAngle(50);

// Create the bar pot
$bplot = new BarPlot($datax);
$bplot->SetWidth(0.6);

// Setup color for gradient fill style
$bplot->SetFillGradient("navy:0.9","navy:1.85",GRAD_LEFT_REFLECTION);

// Set color for the frame of each bar
$bplot->SetColor("white");
$graph->Add($bplot);

$gdImgHandler $graph->Stroke(_IMG_HANDLER);

// Finally send the graph to the browser
$fileName $imagen;
$graph->img->Stream($fileName);
 
// Send it back to browser
$graph->img->Headers();
$graph->img->Stream();
?>
El problema segun entiendo es por las fuentes, pero no se como agregarlas, ya que la puse en el directorio raiz y cambie lo siguiente:
Código PHP:
define('TTF_DIR','/home/usuario/public_html/site/'); 
y Alli aloje el archivo verdanab.ttf que saque de la carpeta de Windows
__________________
Juguetes Sexuales

Etiquetas: internet, jpgraph, local, mal
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:19.