hello,

i have the following code..it works nice OUT OF DRUPAL.

<script type="text/javascript" src="chart/js/swfobject.js"></script>

<div id="flashcontent">
   This text is replaced by the Flash movie.
</div>


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

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

$data = array();
for( $i=0; $i<5; $i++ )
{
  $data[] = rand(5,15);
}

$g = new graph();
$g->bg = '#E4F0DB';

//
// PIE chart, 60% alpha
//
$g->pie(60,'#FFFFFF','{display:none;}',false,1);
//
// pass in two arrays, one of data, the other data labels
//
$g->pie_values(
  array(40,40,10,10),
  array('A','B','C','C') );
//
// Colours for each slice, in this case some of the colours
// will be re-used (3 colurs for 5 slices means the last two
// slices will have colours colour[0] and colour[1]):
//
$g->pie_slice_colours( array('#abbd15','#e5eac0','#4a7e00','#799908') );
$g->set_tool_tip( '#val#% #x_label#' );
$g->bg_colour = '#FFFFFF';

$g->set_width( 150 );
$g->set_height( 150 );

$g->set_output_type('js');
echo $g->render();
?>

now i should be used this code (based on open flash chart) in association with the module "Open Flash Chart API" for drupal 5.x.

but i get different errors in my drupal node:

Fatal error: Class 'graph' not found in xxx\themes\xxx\node-xxx.tpl.php on line 99

or

Fatal error: Cannot redeclare class line_hollow in xxx\themes\xxx\ofc-library\open-flash-chart.php on line 1376

can anybody help me to integrate the chart-code?

thanks

Comments

fryswe’s picture

Category: task » support

i am trying to integrate a open flash chart into a drupal node..but i get the following error..any ideas what are going wrong? (durpal 5)

Fatal error: Cannot redeclare class line_hollow in \xxx\sites\all\modules\open_flash_chart_api\ofc-library\open-flash-chart.php on line 1376

aaarrggg*

nevets’s picture

See http://drupal.org/node/193294 and please do not post the same issue multiple times (I removed the duplicates)

fryswe’s picture

i used this very short documentation..but it doesnt works

fryswe’s picture

Assigned: fryswe » Unassigned
Status: Active » Closed (fixed)