I am trying to create a bar graph for my test data, I have created two 
columns, one for the test name and other one is number of failed tests. 
This works perfectly fine. But my problem is on my selection handler if 
user clicks on say for example "TestA's failed tests bar" then i need to 
get list.Suites[i].test_id value not the failed tests number. I am not sure 
how to set this value as chart's input without making it visible for users.

I have earlier worked with SWT and we can set an object as input to any 
widget and manipulate the label provider to show what we want to show.

In google charts, DataTable types only take string, number, datatime. How 
do we set an object as Datatype row. Or how can we pass additional data to 
the graph so that we can use them in selection handler.

    graph = new google.visualization.ColumnChart
    (document.getElementById('div'));
    inputDataTable = new google.visualization.DataTable();
    inputDataTable.addColumn('string', 'TestName');
    inputDataTable.addColumn('number', 'Failed Count');
    google.visualization.events.addListener(graph,'select', selectHandler);

    for (var i = 0; i < list.Suites.length; i++) {
     inputDataTable.addRow([list.Suites[i].name, list.Suites[i].failed_count]);
    }
    function selectHandler(e) {
     var selection = graph.getSelection();
     var item = selection[0];
    }

Any help is greatly appreciated.

Thanks,

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-chart-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to