:: Forum >>

Use with PHP and ChartDirector


i am using chart director objects in a php script to plot a bar graph, using 2 data sets.

this same data i want to present in the form of a scrollable table using active widgets.

the data is available in the form of php arrays.

any idea how i can integrate active widgets code in my php script to present the data in table format.

please help soon.

-Amey Pethe.
Amey Pethe
Tuesday, May 17, 2005
    <title>ActiveWidgets Grid :: Examples</title>
    <style> body, html {margin:0px; padding: 0px; overflow: hidden;} </style>

    <!-- ActiveWidgets stylesheet and scripts -->
    <link href="./grid.css" rel="stylesheet" type="text/css" ></link>
    <script src="./grid.js"></script>

    <!-- grid format -->
        .active-controls-grid {height: 100%; font: menu;}
        .active-column-0 {width: 80px;}
        .active-column-1 {width: 200px;}
        .active-column-2 {text-align: right;}
        .active-grid-column {border-right: 1px solid threedlightshadow;}
        .active-grid-row {border-bottom: 1px solid threedlightshadow;}
    <!-- grid data -->
var myData = new Array();
$name = array("c","cc", "ccc");
$sql = "SELECT c , cc, ccc FROM table1";
    foreach($row as $key=>$value){
        echo "myData.push([";
        foreach ($name as $k1=>$v1){
        echo "\"".$value[$v1]."\",";
        echo " ]);";

var myColumns = [
            "Ticker", "Company Name", "Market Cap."
    // create ActiveWidgets Grid javascript object
    var obj = new Active.Controls.Grid;

    // set number of rows/columns
    obj.setRowProperty("count", 20);
    obj.setColumnProperty("count", 3);

    // provide cells and headers text
    obj.setDataProperty("text", function(i, j){return myData[i][j]});
    obj.setColumnProperty("text", function(i){return myColumns[i]});

    // set headers width/height

    // set click action handler
    obj.setAction("click", function(src){window.status = src.getItemProperty("text")});

var row = obj.getTemplate("row");
obj.setProperty("selection/index", 0);

hope it helps...
Monday, May 23, 2005
hi hob,

thanks for your help, i'll see if it works.
Tuesday, May 24, 2005

This topic is archived.

Back to support forum

Forum search