You are here

Open Flash Charts 2 API

Wiki Terms: 

After looking to get open flash charts version 2 working for quite a while here are working directions.

http://drupal.org/node/423046#comment-3362858

Then in the node the directions on this page above were in fact wrong for testing the installation.

use this instead as I posted on this nodes page above.

<?php
//just the out of the box example
print open_flash_chart_api_render();

//now I'll try my own small variation, you can make your own graph with the code below:

  // create new chart object
  $chart = ofc_api_chart();

  // set chart title
  $title = "Open Flash Chart 2 API\nSample Chart";
  if ( !is_null($callback_params) ) {

    $title .= "\nARG1=" . $callback_params[1];
  }
  $chart->set('title', array(
    'text' => $title,
    'style' => '{font-size: 12px; font-family: Verdana, Arial, sans-serif; text-align: center;}',
  ));

  // create new bar_sketch element and set its attributes
  $bar = ofc_api_element('bar_sketch');
  $bar->set('colour', '#81ac00');
  $bar->set('outline-colour', '#567300');
  $bar->set('offset', 7);
  $bar->set('values', array(5, 1, 4, 3, 2, 26));
  $bar->set('tip', 'Value: #val#');

  // add bar_sketch element to the chart
  $chart->add('element', $bar);

 

print open_flash_chart_api_render($chart);
?>

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer