Barchart with Link

Talk about link fields or link implementations

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

daviddelmonte
Master
Master
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");
$dgrid->SetViewModeTableProperties($vm_table_properties); 
$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");
}

$dgrid->SetColumnsInViewMode($vm_columns);


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

Thanks

administrator
Site Admin
Site Admin
Posts: 5990
Joined: Jan 7th, '09, 23:18
Contact:

Re: Barchart with Link

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

Open datagrid.class.php, find there:

switch($field_type){
case "barchart":
...........
Now add there your changes....
...........
break;
case "blob":


Return to “Field type: "link"”