Views custom field (VCF) allows one to reformat the dates to be compatible with charts, it also allows you to use a row number in the x axis and lastly would allow you to create a simple baseline in the graph, *IF* it worked with Views Charts.

When I try and use a value generate by VCF, all the data piles up inthe Y axis of the chart and I see some cryptic errors in the view like:

warning: max() [function.max]: Array must contain at least one element in /var/www/sparcs/sites/all/modules/charts_graphs/apis/charts_openflash/charts_openflash.class.inc on line 72.
warning: min() [function.min]: Array must contain at least one element in /var/www/sparcs/sites/all/modules/charts_graphs/apis/charts_openflash/charts_openflash.class.inc on line 74.

Filed this as a feature request.
Thanks
Franco

Comments

danieldd’s picture

I am using this module with views custom field.

So far it seems to work, but you need to use the latest dev version of Views Custom Field.

This has this patch included http://drupal.org/files/issues/views_customfield.sorting.patch, which seems to make the custom fields chartable in this module.

rsevero’s picture

Version: 6.x-1.0-alpha1 » 6.x-1.x-dev
Assigned: Unassigned » rsevero
Status: Active » Fixed

Marking as fixed. Please reopen with new info if necessary.

Status: Fixed » Closed (fixed)

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

orfalas’s picture

I have been trying this patch to sort results but was not rendering the code out of <? ?> tags and sometimes it is usefull

That's because this

- function render($values) {
+ function render_row($values) {
$d = $this->view->display[$this->view->current_display];
$field_handlers = $d->handler->handlers['field'];
foreach ($field_handlers as $h) {

Just leave render function and add render_row function as coded in the patch.

Great aportation. Thank you.

open social’s picture

Nice!

Thanks with the dev version everything works as expected

darrellduane’s picture

This is great news that I can include Custom PHP code to make my graphs appear now that I'm using the dev version of views_customfield. I'm amazed that it works both if I echo out the value or if I return the value within the Views_customfield PHP block.