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.
Open Flash Chart 2 API provides two different methods to render the charts:
- Data file method: requires the user to create a "data file" which, in fact, is a function that returns the chart data. The API will use Drupal menu system to generate a URL that points to that function and pass it to
open-flash-chart.swf
. This is the recommended method to create charts using Open Flash Chart 2 API since it results in a cleaner XHTML output and is easier to maintain than the JavaScript method. To use this method, the user has to create a module which contains the functions that provide the chart data. - JavaScript method: instead of creating a data file, user can create and pass the chart data to
open-flash-chart.swf
via JavaScript. However, this creates a cluttered XHTML output because chart data is written in the same page as the chart itself. This method allows the user to create and display charts on-the-fly without creating a module.
For more information about how to render the chart, see Open Flash Chart 2 tutorial page. The charts in tutorial 1 to 4 are rendered using the data file method, whereas the charts in tutorials 5 and 6 are rendered using the JavaScript method.