https://drupal.org/project/charts is the best D7 upgrade path from this module. Charts module provides access to the "new" Google Interactive charts. Please migrate your sites to it.

Has there been any discussion or thoughts on using the new and improved interactive API?

http://code.google.com/apis/chart/interactive/docs/gallery.html

I've found that they paste into the body field quite nicely but the drupal integration seems more fulfilling in the long run.

Cheers!

CommentFileSizeAuthor
#11 1196712.patch4.68 KBhairqles
#3 chartstuff.zip24.66 KBsvdhout
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drclaw’s picture

+1 for this.

Although these new google charts are built using Javascript so I imagine integration would be quite a bit of work... =/

kiaben’s picture

GOOD

svdhout’s picture

FileSize
24.66 KB

In was in need of this functionality as wel, so i started a poc to implement this.

Instead of keeping the chart api limited to google charts i wanted to provide the possibility to use other chart frameworks.

I started off with adding a hook_chart_api_info so other modules could identify themself as a 'chart provider'


/**
 * implementation of hook_chart_api_info
 */
function chart_chart_api_info() {
  return array(
    'chart' => array(
      'title' => t("Google Images Chart API"),
      'description' => t('Integrate !apilink', array('!apilink' => l('http://code.google.com/intl/en/apis/chart/', 'Google images Chart API '))),
      'help' => t('help text'),
      'module' => 'chart',
    ),
  );
}

In charts_settings i added a field to select wich api to use

  $apis = module_invoke_all('chart_api_info');
  foreach($apis as $name => $api) {
    $api_options[$name] = $api['title'];
  }
  $form['chart_api'] = array(
      '#type' => 'select',
      '#title' => t('API'),
      '#description' => t('Witch API will be used.'),
      '#default_value' => variable_get('chart_api', 'chart'),
      '#options' => $api_options,
      '#size' => count($apis),
    );

(i moved these settings to chart.admin.inc as well)

On function chart_render() a hook gets invoked so the chosen chart provider can render it's own chart.

function chart_render($chart, $attributes = array()) {
  $choosen_api = variable_get('chart_api', 'chart');
  return module_invoke($choosen_api, 'chart_render', $chart, $attributes);
}

The original chart_render function is now called chart_chart_render

  function chart_chart_render($chart, $attributes) {...

With that set up i was able to create a custom module that provided the interactive google chart support.

The chartstuff module is a proof of concept that adds 4 blocks with charts. (Column chart, Line Chart, Area Chart & Gauge Chart)
Enable chartstuff, and these blocks for a preview containing the interactive google charts.
(Change the chart api settings to "Google chart tools api" (admin/settings/chart))

Chartstuff depends on a module corecharts (contained within chartstuff), that creates the javascript files

As said this module is only a proof of concept, and probably has some issues, but it might point to the right direction.

nkschaefer’s picture

This module sounds like a good idea. While I don't know much about this, though, it sounds like what the Charts module (http://drupal.org/project/charts) is trying to accomplish. You may already know about this -- I just want to make sure we're all focusing our effort in the same place.

Maybe you could help spiff up that module, and provide integration with the new Google Charts API (and maybe even help get a stable 7.x release out).

owntheweb’s picture

+1 :)

I'm in need of this (I greatly desire it anyway). I'm in the process of attempting a D6/D7 version of CSV Chart. Should I also try to butcher Google Charts API with a patch of some kind while I'm at it? Not totally sure what I'm getting into yet but will know soon after I catch up with Git.

Feel free to post any thoughts on where to get started. This module looks pretty straight forward in general.

13rac1’s picture

I'd like to support both versions of Google Charts. I don't have time to create build this, but I'm happy to review patches.

owntheweb’s picture

eosrei,
I started playing with it. It's on hold until October 1st due to new project but will let you know what happens ASAP when I resume charting efforts.

Thanks for your great work.

13rac1’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

I set #1305976: Initial interactive/JS Google Chart Tools implementation as a duplicate of this. Note: that issue contains working code.

owntheweb’s picture

Good to know. Thanks!

windmaomao’s picture

i'd like this to be implemented, interactive ones just way more better than the old one. If i have time, i might implement the patch from above to drupal 6 and see if it works for the dashboard I'm building. thanks.

Fang

hairqles’s picture

FileSize
4.68 KB

Hi

I created quick patch for this issue. I hope that it could be a good starting point.

cheers

JordanMagnuson’s picture

The patch in #11 looks like a great start... has any further work been done on this?

JurriaanRoelofs’s picture

13rac1’s picture

https://drupal.org/project/charts_graphs may be the best option moving forward, although work on that project has slowed with no commits in the last six months.

13rac1’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Adding recommendation to issue summary.

JordanMagnuson’s picture

I'm personally now using https://drupal.org/project/charts which recently got re-factored by quicksketch, and has been working great for me.

Pierre.Vriens’s picture

Priority: Normal » Critical
Status: Closed (won't fix) » Active

I'm reopening this issue (and changing the priority!) in attempt to get feedback about the feasibility of this proposal: how about using this issue as a starting point for providing a migration path from chart to charts? In my opinion it already contains quite some interesting contributions to start from!

If that makes sense, I suggest to update the issue title to something like 'Migrate to charts module'.

I look forward to feedback about my proposal here (and thumbs up for it). Without anything like that: sorry for asking, I'll restore the previous metadata about this issue (and might create another wake-up call issue for those +25K sites still using chart ...).

Note: be aware of my related updates in #1305976: Initial interactive/JS Google Chart Tools implementation, as a potential alternative to consider by those +25K sites still using chart today.

Pierre.Vriens’s picture

@owntheweb: regarding your #5, would you mind checking out #2368971: Upgrade to Drupal version 7 and/or #2368967: Upgrade to Drupal version 6 and provide your feedback to them (via those issues)? Maybe you want to share anything you have/know about it also?

PS 1: sorry we're over 3 years later now ... hope it's still OK to ask.
PS 2: not sure what that "butcher" is all about (I'm not native English speaking, so slang or expressions are sometimes a challenge). There is a real one around the corner where I live, but for sure he doesn't have a clue what Drupal is all about ...

owntheweb’s picture

PS 1: sorry we're over 3 years later now ... hope it's still OK to ask.

@Pierre.Vriens,
Not a problem. I ended up going a different direction while creating custom chart solutions for a project (sorry, can't recall details three years later). As this project has been depreciated, I (along with the module maintainers) recommend checking out the Charts module:

"The Google Chart Tools: Image Charts API was deprecated by Google on April 20, 2012 and will be shutdown April 20, 2015. Do not build new functionality using this module.

The Charts module provides access to the "new" Google Interactive charts. Please migrate your sites to it."

PS 2: not sure what that "butcher" is all about (I'm not native English speaking, so slang or expressions are sometimes a challenge). There is a real one around the corner where I live, but for sure he doesn't have a clue what Drupal is all about ...

Mention of butchering Google Charts API was related to my strong sense of sarcasm dry humor, resulting in fine cuts of code prepared in a way much like the butcher around your corner would prepare a cow... and not nearly as useful when finished. ;)

I'm sorry that I cannot assist specifically with your endeavor this time and wish you success.