This content has been marked as final.
Show 13 replies

1. Re: How to get to the underlying data element for a Graph ClickEvent?
Frank NimphiusOracle May 13, 2007 2:17 PM (in response to Lucas Jellema)Hi,
public void onClick(ClickEvent clickEvent) {
DataComponentHandle dch = (DataComponentHandle)clickEvent.getComponentHandle();
UIGraph m_graph = (UIGraph) clickEvent.getSource();
int iColNum = ((DataComponentHandle)dch).getColumn();
int iRowNum = ((DataComponentHandle)dch).getRow();
System.out.println("mouseClicked(): Number of column in graph: " + (iColNum+1));
System.out.println("mouseClicked(): Number of row in graph: " + (iRowNum+1));
Object graphData = null;
try {
graphData =
m_graph.getGraphDataModel().getDataAccess().getValue(iRowNum,iColNum,DataMap.DATA_UNFORMATTED);
} catch (RowOutOfRangeException e) {
// TODO
} catch (ColumnOutOfRangeException e) {
// TODO
}
System.out.println("mouseClicked(): Data value clicked on: "+graphData.toString());
}
Frank 
2. Re: How to get to the underlying data element for a Graph ClickEvent?
Lucas Jellema May 13, 2007 6:56 PM (in response to Frank NimphiusOracle)Frank,
That was a quick response! Thanks very much. Missed you at JavaOne  will we meet in Daytona Beach?
Lucas 
3. Re: How to get to the underlying data element for a Graph ClickEvent?
Lucas Jellema May 13, 2007 7:13 PM (in response to Frank NimphiusOracle)Frank,
Sorry to bother you again: How do I get the dimension values for the clicked on element? So in addition to the data element, how do I know the value for the dimension? Say I have have stacked barchart with a bar per department and a stack per job. How do I know which Department and Job were selected/clicked on?
Thanks for your help.
Lucas 
4. Re: How to get to the underlying data element for a Graph ClickEvent?
Frank NimphiusOracle May 13, 2007 10:41 PM (in response to Lucas Jellema)Lucas,
good question. Will need to look this up  not sure this is exposed in the graph. Let you know when I found something
Actually I miss the two big events this year: JavaOne and ODTUG. Parallel to ODTUG there is the ODC in Munich where I am presenting. Hopefully next year.
Frank 
5. Re: How to get to the underlying data element for a Graph ClickEvent?
Katarina ObradovicSarkicOracle May 16, 2007 1:47 PM (in response to Lucas Jellema)Hi,
Here is hwo you cmna retrieve the dimension members info:
int col= ((DataComponentHandle)dch).getColumn();
int row = ((DataComponentHandle)dch).getRow();
String rowDimMember = m_graph.getGraphDataModel().getDataAccess().getMemberMetadata(DataDirector.ROW_EDGE,
0,/*layer*/
row,/*slice*/
MetadataMap.METADATA_LONGLABEL);
String colDimMember = m_graph.getGraphDataModel().getDataAccess().getMemberMetadata(DataDirector.COLUMN_EDGE,
0,/*layer*/
col,/*slice*/
MetadataMap.METADATA_LONGLABEL);
Hope this helps
Katia 
6. Re: How to get to the underlying data element for a Graph ClickEvent?
Lucas Jellema May 16, 2007 3:09 PM (in response to Katarina ObradovicSarkicOracle)Katia,
Thanks a lot. That certainly gets me a step closer to what I am looking for. Unfortunately, I am not yet there all the way. I am working with a StackedBarChart and it has one additional dimension. My chart is showing a bar per department and a stack per job. With your help I have been able to get to the DataPoints: the Stack  that's the Row Dimension  and the overall label of the Graph (returned as the Column dimension). I am wondering whether the Group or is available and if so, if that is where I will find the Bar Value (the Department number).
best regards and thanks again for your help,
Lucas 
7. Re: How to get to the underlying data element for a Graph ClickEvent?
Lucas Jellema May 16, 2007 4:30 PM (in response to Lucas Jellema)After some investigation I found out that with 2 data points and one group, I can find my Group value using:int iGrpNum = ((DataComponentHandle)dch).getGroup();
However, I do not really understand what I am doing here, except from the fact that it does the trick.
Object groupValue =
graph.getGraphDataModel().getDataAccess().getMemberMetadata(
DataDirector.COLUMN_EDGE,new int []{0,iGrpNum,0}
,2,// sets the dimension: 0 is Data Point 0 (Sum of Sal), 1 is Job (Data Point 1) and 2 is Group (Deptno)
0,
MetadataMap.METADATA_LONGLABEL);
Can you explain? Or suggest a better way?
Thanks!
Lucas 
8. Re: How to get to the underlying data element for a Graph ClickEvent?
Frank NimphiusOracle May 17, 2007 3:10 PM (in response to Lucas Jellema)Hi,
actually I have no clue ;)
Will forward
Frank 
9. Re: How to get to the underlying data element for a Graph ClickEvent?
Katarina ObradovicSarkicOracle May 17, 2007 3:26 PM (in response to Lucas Jellema)Hi Lucas,
You should be able to get the same information using this simpler call:
String group = m_graph.getGraphDataModel().getDataAccess().getSliceLabel(DataDirector.COLUMN_EDGE,iGrpNum, MetadataMap.METADATA_LONGLABEL);
How did you create a data source for this Graph? Did you create an ADF BC view and bound the graph to a data control?
Thanks
Katia 
10. Re: How to get to the underlying data element for a Graph ClickEvent?
Frank NimphiusOracle May 17, 2007 3:32 PM (in response to Katarina ObradovicSarkicOracle)Hi Katia,
yes, this is how Lucas did it
Frank 
11. Re: How to get to the underlying data element for a Graph ClickEvent?
577627 Jun 4, 2007 9:51 AM (in response to Katarina ObradovicSarkicOracle)Thanks a lot for this. Now suppose i want to create a new graph besides the original one, based on my clicked component of graph (drill down), how should i go forward?
Any help will be appreciated. Thanks 
12. Re: How to get to the underlying data element for a Graph ClickEvent?
Frank NimphiusOracle Jun 4, 2007 10:10 AM (in response to 577627)Hi,
please open your own thread
Frank 
13. Re: How to get to the underlying data element for a Graph ClickEvent?
577627 Jun 5, 2007 4:48 AM (in response to Frank NimphiusOracle)Thanks Frank, I have opened my own thread
Creating Graph based on runtime conditions
can you please give some inputs?? Sort of urgency! Any help is welcome.
Thanks