Render chart with data from Views PHP custom field How to render a Column Chart using data from Views PHP custom field (BAR Number (PHP custom) in the screenshot below)?



I am trying to achieve a Column Chart; with each bar in the chart being distinct count number of "bar number".


I have tried using aggregation (with charts module chart add-on enabled), but does not give option to aggregate/count on PHP custom fields.
have tried Google Chart Tools module, but again it does not consider PHP Views custom fields for Grouping.


Just for more information on what I am trying to achieve, please refer below Requirement screenshot!

Thanks in advance!
A work around for issue 1. &amp; 2. Add Bar number as a field to each study node. Then add field to view, and aggregate. 

How exactly is the Bar Number being calculated? You could use Rules to calculate this value when node is saved and save the calc number to your Bar number field. If there is no calculation, then ignore this part. 

Use field permissions to not allow certain roles to change the value of this field, if needed.



Add a new field called Bar Number (machine name: field_bar_number) to your study content type. 

You can create a custom module.

mymodule.info

name = My Module
description = Makes calculation for Bar Number field in Study content type.
package = Custom
version = 7.x-1.0
core = 7.x


mymodule.module

/**
 * Implements of hook_node_presave
 */
function MYMODULE_node_presave($node) {
  if ($node-&gt;type =='study') {
    // calculates bar number
    $node-&gt;field_bar_number = $node-&gt;some_field - $node-&gt;other_field;                          
  }
}


Use Views Bulk Operations and set title = title, and save again all your 500 nodes. As your custom module makes the calculation and sets the bar number before the node is saved. VBO Tutorial.