Barchart with Link

Talk about link fields or link implementations

Moderator: alexandrleonenko

Posts: 159
Joined: Feb 23rd, '10, 15:06

Barchart with Link

Postby daviddelmonte » Jul 27th, '10, 18:22

Hi.. I have a grid that outputs a barchart (sales by year).

That works, but I'd like to be able to click on a bar and go to a page with all transactions from that year.

This is my barchart code:

Code: Select all

$vm_table_properties = array("width"=>"444px");
$max_value = "3000";

# Todays Year (2010)
$yrNow = date('Y');

# Ten years ago (2000)
$yrMinusTen =  $yrNow - 10;
# Placement value beside the [year] inside the array
# Start at 0 not 1, because year0 would be 2000, and [year1] would be confusing, [year0] looks more like 2000
$i = 0;

# Loop through it.
for ($y = $yrMinusTen; $y <= $yrNow+2; $y++)
$vm_columns ['year'.$i++] = array(  "header"=> ($y -1), "type"=>"barchart",  "align"=>"center", "width"=>"100px", "wrap"=>"nowrap", "visible"=>"true", "on_js_event"=>"", "field"=>"", "maximum_value"=>$max_value, "display_type"=>"vertical");


Can you tell me a way to link to (for example) where x is the column that has been selected..


Site Admin
Site Admin
Posts: 6025
Joined: Jan 7th, '09, 23:18

Re: Barchart with Link

Postby administrator » Jul 28th, '10, 08:46

Open datagrid.class.php, find there:

case "barchart":
Now add there your changes....
case "blob":

Return to “Field type: "link"”