It seems like the value of a column is not sent to Google API, but the node id.
When I check the field 'Append value to label', I see 'column name:<nid>', not 'column name:<value>'. The charts do not show any sensible data, since column values are not used.
I created 2 different views: one with integers as columns, another with text. Both have the same problem.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

maulik.kamdar’s picture

I faced the same problem with Views integration. Developing a chart using Taxonomy Data also sends the 'tid' and not the value. I believe it is due to the use of $row->{$field->field_alias} which returns the value of the 'nid' or the 'tid' for the nodes and taxonomy terms respectively.
The only possible explanation I have arrived is views renames field aliases in $data field as it wants (applying filters, changing the exposed filter values etc.) , and should never be referred in the result directly. This should be changed.

There is a similar issue and ensuing solutions in Views (6.x) #361756: Updating views fields changes field alias names

johnv’s picture

Another question regarding this: is the Views-formatter applied before sending data to Google API (which is preferred), or after (in which case the formatter is effectively not used)?

wictdrup’s picture

+ 1. The same problem. There is a Pie but populated with NIDs instead of fields values.

Ranko’s picture

+1 and in addition I am 100% sure I saw a case where (and am trying to replicate) the output were the labels. Then I did something and now I am getting only nid's.

johnv’s picture

@Ranko, I'm eager to hear your working solution. The module system_charts gives correct pies, but they are programmed instead of created via the Views UI.

Ranko’s picture

@johnv I wrote inaccurately, somehow I had them show labels only, not the values of them.

claudiu.cristea’s picture

Status: Active » Needs review
FileSize
1.69 KB

There's a patch. Testing needs.

wictdrup’s picture

The patch has not solved my problem, unfortunately:

Fatal error: Cannot access empty property in ...\www\sites\all\modules\chart\chart_views\views\chart_views_plugin_style_chart.inc on line $chart['#data'][$field->field_alias][] = (int) $row->{$object_key};

When I left for testing purpose only one string from patch $object_key = $field->aliases[$field->real_field]; (the other from patch I have commentar), I got following message:
Notice: Undefined index: ...

johnv’s picture

Status: Needs review » Needs work
johnv’s picture

Status: Needs work » Needs review
FileSize
1.36 KB

Patch #7 didn't solve my problem. Attached patch does.
It does however use the new views_handler_field_field::get_value() function from Views, so a recent Views-version is required.

13rac1’s picture

Thanks! Do you know the specific Views version, so it can be documented?

johnv’s picture

Well, my version stems from 2011-04-16, and it didn't exist in that version.

13rac1’s picture

Hmm... There isn't a 2011-04-16 release for Views: http://drupal.org/node/38878/release

I found it. Added ::get_value() method to all fields to make it easier for systems like services that need to access raw field data. It should now be much more consistent. - http://drupal.org/node/1192186 for Views 7.x-3.0-rc1

defconjuan’s picture

Patch works for me.

paulfield05’s picture

Patch is worked for me - thanks Johnv

ArchangelGuidz’s picture

Patch works! Hope this gets integrated into the latest build. Thanks!

johnv’s picture

Status: Needs review » Reviewed & tested by the community

3 positives ==> RTBC

kmare’s picture

patch worked for me as well.
Thanks!

13rac1’s picture

Status: Reviewed & tested by the community » Fixed

Patch needs to run from module root, not sub-module root. Works correctly otherwise. Committed to 7.x-1.x-dev. Thanks!

Status: Fixed » Closed (fixed)

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

mfoda’s picture

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

is patch in #10 supposed to work with views 7.x-3.3 and google charts 7.x-1.1?

I just ran the patch but I'm getting a blank page with only the title and no errors, whereas I had the correct pie chart with nid labels before.

mfoda’s picture

to clarify the charts are being generated as the space is being filled out and the chart title and labels are also showing. However the chart itself is not there. Maybe something went wrong with the color scheme? Just a guess.

mfoda’s picture

Any ideas? Anyone? I'm nearing launch date for my website and it would make a big difference if I had the charts included. Right now it's a no-go with the nid labels being shown instead of values.

Thanks in advance

johnv’s picture

Mfoda, this issue is closed for a long time, so noone will see this. You should try 1.x,, or choose any of the new chart modules that have been published lately. Good luck!

13rac1’s picture

mfoda, please use the dev version for now. There are many changes to dev.

mfoda’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
FileSize
14.45 KB

I took your advice and installed the dev version. The new problem I have right now is that no matter what parameters I try with width and height the labels are cut off from the side and not showing completely. See attached picture.

Any ideas how to fix this?

mfoda’s picture

sorry double post

kimberlydb’s picture

FileSize
43.03 KB

I installed the dev version but I still get the same problem. The nid still appears for all the values in the chart.

Nevermind, was caching the old install, the dev version works.

kimberlydb’s picture

Issue summary: View changes

correcting special char's