Hey, I am a little embarrassed to ask this. I am a new drupaller and am not sure how I can use this module. When I type the php code to use the api's features in a "page". Drupal filters it and gives the code in HTML rather than executing it!

Can you please point me to some resource on how to use this or give me more info. Thanks!! Your reply is very much appreciated!

P.S. I am using the Version 6 Alpha build (this option was unavailable in the support request form)

Comments

tjholowaychuk’s picture

Hello,

Unfortunately I cannot give alot of advice when it comes to learning PHP etc, but I have examples at http://code.google.com/p/drupal-chart-api/wiki/Examples
This module currently does not support Drupal 6 ( it should shortly ) so you may want to fool around with it on Drupal 5, the module will not see much change for the Drupal 6 version.

tjholowaychuk’s picture

Status: Active » Closed (fixed)
shaibenyehuda’s picture

Status: Closed (fixed) » Active

I would like to put the php code in the article body and use the php input format.

i tried to do it with the code from the example:

  $chart = array(
      '#chart_id' => 'test_chart',
      '#title' => t('Servings'),
      '#type' => CHART_TYPE_PIE_3D,
    );
    
  $chart['#data']['fruits'] = 3;
  $chart['#data']['meats']  = 2;
  $chart['#data']['dairy']  = 5;

  echo chart_render($chart);

but the php can not recognize chart_render()

can i make work?
if so, how should I fix the php code?

thanks,

shai

kwemart’s picture

Title: Usage » simple

go to admin section admin/build/block then create a new block using php format under the textarea choose php format your php code will be executed..

Martin

tjholowaychuk’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

federico’s picture

Maybe you forgot to add <?php and ?>

<?php
  $chart = array(
      '#chart_id' => 'test_chart',
      '#title' => t('Servings'),
      '#type' => CHART_TYPE_PIE_3D,
    );
   
  $chart['#data']['fruits'] = 3;
  $chart['#data']['meats']  = 2;
  $chart['#data']['dairy']  = 5;

  echo chart_render($chart);
?>