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 Import (Moderator: Yashodha Chaku) »
  • Google Charts not showing after import
Pages: [1]

Author Topic: Google Charts not showing after import  (Read 1657 times)

domesticat

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Google Charts not showing after import
April 01, 2009, 12:09:23 pm
I've done an import of a very incomplete data set into CiviCRM and I can see all of the contacts and their contributions, but the Google Charts are not working properly.  I see totals for fiscal year-to-date and cumulative-since-inception, but Google is returning a Bad Request error for the requested charts.

Here are the images it's trying to grab:

http://chart.apis.google.com/chart?cht=bar&chs=300x150&chd=t:&chl=&chtt=&chco=99C754|54C7C5|999999&chxl=1:|0|USD-&chxt=x,y&chds=0,&chf=bg,s,fafafa&chm=

http://chart.apis.google.com/chart?cht=bar&chs=300x150&chd=t:&chl=&chtt=&chco=99C754|54C7C5|999999&chxl=1:|0|USD-&chxt=x,y&chds=0,&chf=bg,s,fafafa&chm=

In both cases, I get the following error:

Quote
Bad Request
Your client has issued a malformed or illegal request.

    * The parameter 'chds=0,' does not match the expected format.
    * The parameter 'chm=' does not match the expected format.
    * The parameter 'cht=bar' does not match the expected format.

I am hoping that I missed a config option somewhere, or I am missing some data somewhere that's preventing the charts from working properly.

Any ideas?
webmaster, librarian, general geek
Huntsville, Alabama

Sunil

  • I post frequently
  • ***
  • Posts: 131
  • Karma: 23
  • The community around a product more important than the product itself?
    • CiviCRM
Re: Google Charts not showing after import
April 01, 2009, 10:57:46 pm
Hi

Looking at the url
some the the required parameter are missing the url Like
Chart Type
Quote
cht=bar is wrong
cht=bvg

Chart Data
Quote
chd=t: empty
chd=t:0,0,110.00,1125.00,0,0,0,0,0,0,0,0

The example here

http://chart.apis.google.com/chart?
    cht   = bvg
    chs   = 440x250
    chd   = t : 0, 0, 110, 1125, 200,0,0,350,400,450,500,550
    chl    = Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
    chtt  = By Month -2008
    chco = 99C754|54C7C5|999999
    chxl  = 1:|0|USD-1350
    chxt  = x,y
    chds  = 0,1350
    chm   = t0,0000FF,0,0,11          | t0,0000FF,0,1,11         |  t110.00,0000FF,0,2,11 |
               t1125.00,0000FF,0,3,11 | t200.00,0000FF,0,4,11  | t0,0000FF,0,5,11         |
               t0,0000FF,0,6,11          | t350.00,0000FF,0,7,11  | t400.00,0000FF,0,8,11  |
               t450.00,0000FF,0,9,11  | t500.00,0000FF,0,10,11 | t550.00,0000FF,0,11,11
   
Combine above all parameter will get the proper chart with marker

http://chart.apis.google.com/chart?cht=bvg&chs=440x250&chd=t:0,0,110.00,1125.00,200.00,0,0,350.00,400.00,450.00,500.00,550.00&chl=Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec&chtt=By%20Month%20-%202008&chco=99C754|54C7C5|999999&chxl=1:|0|USD-1350&chxt=x,y&chds=0,1350&chf=bg,s,fafafa&chm=t0,0000FF,0,0,11|t0,0000FF,0,1,11|t110,0000FF,0,2,11|t1125,0000FF,0,3,11|t200,0000FF,0,4,11|t0,0000FF,0,5,11|t0,0000FF,0,6,11|t350,0000FF,0,7,11|t400,0000FF,0,8,11|t450,0000FF,0,9,11|t500,0000FF,0,10,11|t550,0000FF,0,11,11


Sunil
The community around a product more important than the product itself?

domesticat

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: Google Charts not showing after import
April 02, 2009, 06:19:01 am
Sunil -

This is a good start, thanks. The problem is that these charts are auto-generated by CiviCRM. The fact that these fields are empty tells me there is something in the database that isn't right after the import. It sounds like data's missing.

These missing values - chart type and chart data - where would they be stored in the database?

(Example - in Drupal, you can import nodes into the 'node' and 'node_revisions' tables, but afterwards you must update the 'sequences' table so drupal knows what the next uid, nid, etc. are. This feels like a similar error.)
webmaster, librarian, general geek
Huntsville, Alabama

Sunil

  • I post frequently
  • ***
  • Posts: 131
  • Karma: 23
  • The community around a product more important than the product itself?
    • CiviCRM
Re: Google Charts not showing after import
April 02, 2009, 08:19:13 am
Hi

Chart Type and Chart Data are defined in php file, nothing is stored in db

for $chartType and $chartData plz see the line no. around 94 and 166 receptively in CRM/Contribute/Form/ContributionCharts.php

you can also debug,
put the debug statement in ContributionCharts.php
CRM_Core_Error::debug( '$chartMonthly-By Month', $chartMonthly['By Month'] ); below the
Code: [Select]
$chartMonthly['By Month'] = array_combine($abbrMonthNames,$chartInfoMonthly['By Month'] );around line no. 132

all information is assigned to template file templates/CRM/Contribute/Form/ContributionCharts.tpl


Sunil
The community around a product more important than the product itself?

domesticat

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
Re: Google Charts not showing after import
April 02, 2009, 12:06:40 pm
Ugh. I have no idea why it did this, but I ended up typing something in the .tpl file that seems to have forced the templates to refresh. When I did that, I got charts.

I have zero explanation for this, but at least it's working now.
webmaster, librarian, general geek
Huntsville, Alabama

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Import (Moderator: Yashodha Chaku) »
  • Google Charts not showing after import

This forum was archived on 2017-11-26.