CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Custom Graphs In "Contact" Tab?
Pages: [1]

Author Topic: Custom Graphs In "Contact" Tab?  (Read 1265 times)

DerekL

  • I post frequently
  • ***
  • Posts: 132
  • Karma: 1
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.54
  • PHP version: 5.2.17
Custom Graphs In "Contact" Tab?
May 10, 2013, 12:38:15 pm
Hi All,

I've been asked to create a new tab for "individuals" that displays their employer membership information in a visual breakdown, ie: total membership contributions by year,  all time contributions total, etc.

I've gotten as far as creating the tab and writing the code to get me the numbers I need, but I am at a loss as to leveraging civicrm's built in visualization features. I tried using google charts API, but there are JS layers involved in that page that I was not able to overcome in order to get things working.

Has anyone here had any experience with this kind of thing?


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Custom Graphs In "Contact" Tab?
May 10, 2013, 05:33:10 pm
Might want to check CRM_Contribute_Form_ContributionCharts class for an example of using the OpenFlashCharts library used elsewhere in Civi. Note that there has been talk about switching to a new charts library at some point - but not on the short term road-map.

Other folks might have suggestions for a simpler / better way of course.
Protect your investment in CiviCRM by  becoming a Member!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Custom Graphs In "Contact" Tab?
May 12, 2013, 04:22:12 am
You can also try some of Drupal's charting modules. Or Google provides a way (last I checked) to get a chart back from a simple URL.

Actually it looks like it's deprecated yet still works: https://developers.google.com/chart/image/

A wacky option would also be to load an iframe in the tab and then a fresh page, then no JS conflicts should be there.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Custom Graphs In "Contact" Tab?

This forum was archived on 2017-11-26.