Ver Mensaje Individual
  #11 (permalink)  
Antiguo 05/07/2009, 10:16
Avatar de pablolennin
pablolennin
 
Fecha de Ingreso: diciembre-2008
Ubicación: Trujillo
Mensajes: 169
Antigüedad: 15 años, 4 meses
Puntos: 1
Respuesta: Open Flash Chart

ya descargate la version anterior, la penultima version

descomprime

ahi tendras una carpeta llamada ofc-library y el .swf respectivamente

luego

crea un nuevo archivo php

copia esto

Cita:
<?php
include_once 'ofc-library/open_flash_chart_object.php';
open_flash_chart_object(800,600,'c_3d.php',false);
?>
luego

crea un otro archivo php con este nombre c_3d.php ok y copia este codigo dentro del Body

Cita:
<?php

include_once( 'ofc-library/open-flash-chart.php' );

// generate some random data
srand((double)microtime()*1000000);


$bar_1 = new bar_glass( 55, '#D54C78', '#C31812' );
$bar_1->key( '2006', 10 );

// add 10 bars with random heights
for( $i=0; $i<10; $i++ )
$bar_1->data[] = rand(2,5);


//
// create a 2nd set of bars:
//
$bar_2 = new bar_glass( 55, '#5E83BF', '#424581' );
$bar_2->key( '2007', 10 );

// make 10 bars of random heights
for( $i=0; $i<10; $i++ )
$bar_2->data[] = rand(-5,9);


//
// create the chart:
//
$g = new graph();
$g->title( 'hola ferdinandum', '{font-size:20px; color: #bcd6ff; margin:10px; background-color: #5E83BF; padding: 5px 15px 5px 15px;}' );

// add both sets of bars:
$g->data_sets[] = $bar_1;
$g->data_sets[] = $bar_2;

// label the X axis (10 labels for 10 bars):
//$g->set_x_labels( array( 'January','February','March','April','May','June', 'July','August','September','October' ) );
$g->set_x_labels( array( 'Enero','Febrero','Marzo','Abril','Mayo','Junio',' Julio','Agosto','Setiembre','Octubre' ) );
// colour the chart to make it pretty:
$g->x_axis_colour( '#909090', '#D2D2FB' );
$g->y_axis_colour( '#909090', '#D2D2FB' );

$g->set_y_min( -5 );
$g->set_y_max( 10 );
$g->y_label_steps( 6 );
$g->set_y_legend( 'Open Flash Chart', 12, '#736AFF' );
echo $g->render();
?>
y listo puedes asignarle valores los que quieras ahi en el arreglo data[] en este ejemplo se esta creando aleatoriamente desde -5 hasta 9 todos los valores que apareceran en la grafica perteneceran a ese rango.