Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
- Download and install Open Flash Chart 2 API module
- Download the latest Open Flash Chart 2 package from http://teethgrinder.co.uk/open-flash-chart-2/downloads.php
-
Extract the package, put the
open-flash-chart.swf
file in the module's directory. The directory layout should look like this:ofc_api |-- ofc_api.info |-- ofc_api.module |-- swfobject.js |-- open-flash-chart.swf |-- ...
-
If you want to use an external library e.g. the one that comes with Open Flash Chart 2 package, copy the
php-ofc-library
directory into the module's directory as well. The resulting directory layout should look like this:ofc_api |-- ofc_api.info |-- ofc_api.module |-- swfobject.js |-- open-flash-chart.swf |-- php-ofc-library |-- open-flash-chart.php |-- ... |-- ...
-
Configure Open Flash Chart 2 API by going to
/admin/settings/ofc_api
- You can verify the installation by creating a new Page or Story, set input format to PHP code and put the following code in the body:
<?php print ofc_api_render(); ?>
Click the "Preview" button, if the sample chart shows up then you're good to go :)
Comments
sample code above is wrong but this is working
put this in your node to test:
It seems the API has changed
It seems the API has changed as there is no longer a function called
ofc_api_chart
This worked for me: