Closed (fixed)
Project:
Views Charts
Version:
6.x-1.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
18 Mar 2009 at 01:37 UTC
Updated:
22 Jul 2010 at 18:40 UTC
When adding a node reference field to Chart view, e.g. set it as X and count node ids, the output chart is rendering referenced nodes IDs. This is because of function _transform_data() in views_plugin_style_chart.inc:
function _transform_data() {
$db_rows = $this->view->result;
Calling $this->view->result returns views results in an array with no formatters applied to it, which leads to node ids of referenced nodes instead of titles/linked titles being returned.
Comments
Comment #1
gabidrg commentedA fast and ugly fix replaces on line 178:
with
This is surely an unhappy way to do it, but I see no other approach by now. Maybe assigning labels by using a theme_ function would do some good in the future regarding flexibility. Any other ideas?
Comment #2
irakli commentedThank you. Will look into it and get back to you.
Comment #3
killes@www.drop.org commentedthe same problem applies to fields that have rewriting enabled (through tokens or otherwise). Rather annoying.
Changing status as the suggested solution is not really feasible.
Comment #4
Daniel A. Beilinson commentedFix #1 is badly for me because it brakes rows without node references. So this is my fast and ugly fix for foreach cycle from line 178:
Comment #5
rsevero commentedI've created the following test situation:
Node types: news and newspaper.
The news content type references newspaper.
I created the view below to chart the number of news per newspaper.
It worked as expected, i.e., the chart have the aggregate values per newspaper and the newspaper names were present as the labels.
Please observe that you have to create a relationship between news and newspaper in the view. You can't use the ref field available in news directly otherwise the result won't be aggregated.
Please reopen if the problem persists.
Comment #6
rsevero commentedForgot to mention that I did the above test without any of the code modifications suggested in this issue.