on 06-20-2007 9:40 AM
hi,
I am using business graphics ui element in my webdynpro application.I am able to get the graghical output correctly.I want to have tool tip in my graph so when I place the cursor on a point, the tool tip should give the corresponding value.I have used the following code
try
{
String[] catLabels = {
"Team 1", "\1Tomoko Akino", "\1Hans Bosch", "\1Marvin Smith",
"Team 2", "\1Jose Vega", "\1Bao Yin", "Out of office" };
String[][] pointCustomizing = {
{ "approved", "cancelled", "approvedPartTime" },
{ "approved" },
{ "approved" },
{ "sent", "approvedPartTime", "notsentPartTime", "notsent"},
{ "approved", "zSeveralEntries", "zSeveralEntries",
"zSeveralEntries", "zSeveralEntries", "zSeveralEntries",
"zSeveralEntries" },
{ "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
"outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
"outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
"outOfOffice", "outOfOffice", "outOfOffice" }
};
String[][] pointLabels = {
{ " ", " ", " " },
{ " " },
{ " " },
{ " ", " ", " ", " "},
{ " ", " ", " ", " ", " ", " ", " " },
{ "1", "2", "2", "2", "4", "3", "3", "3", "1", "1", "2", "1",
"2", "1", "1" }
};
String[][][] timeValues = {
{ { "20020528", "20020606" }, { "20020606", "20020608" },
{ "20020610", "20020611" } },
{ { "20020531", "20020606" } },
{ { "20020607", "20020613" } },
{ { "20020527", "20020601" }, { "20020606", "20020607" },
{ "20020612", "20020613" }, { "20020617", "20020619"} },
{ { "20020531", "20020606" }, { "20020531", "20020601" },
{ "20020601", "20020602" }, { "20020602", "20020603" },
{ "20020603", "20020604" }, { "20020604", "20020605" },
{ "20020605", "20020606" } },
{ { "20020527", "20020528" }, { "20020528", "20020529" },
{ "20020529", "20020530" }, { "20020530", "20020531" },
{ "20020531", "20020601" }, { "20020603", "20020604" },
{ "20020604", "20020605" }, { "20020605", "20020606" },
{ "20020606", "20020607" }, { "20020607", "20020608" },
{ "20020610", "20020611" }, { "20020611", "20020612" },
{ "20020612", "20020613" }, { "20020617", "20020618" },
{ "20020618", "20020619" }}
};
String s[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14",};
IPrivateSBusinessGraphicsSampleView.ICategoryNode catNode = wdContext.nodeCategory();
for (int catIndex = 0; catIndex < catLabels.length; ++catIndex)
{
IPrivateSBusinessGraphicsSampleView.ICategoryElement catElement = catNode.createCategoryElement();
catNode.addElement(catElement);
catElement.setDescription(catLabels[catIndex]);
}
// loop over series
IPrivateSBusinessGraphicsSampleView.ISeriesNode seriesNode = wdContext.nodeSeries();
for (int seriesIndex = 0; seriesIndex < timeValues.length; ++seriesIndex)
{
IPrivateSBusinessGraphicsSampleView.ISeriesElement seriesElement = seriesNode.createSeriesElement();
seriesNode.addElement(seriesElement);
// set series attributes (...)
IPrivateSBusinessGraphicsSampleView.IPointNode pointNode = seriesElement.nodePoint();
// loop over points
for (int pointIndex = 0; pointIndex < timeValues[seriesIndex].length; ++pointIndex)
{
IPrivateSBusinessGraphicsSampleView.IPointElement
pointElement = pointNode.createPointElement();
pointNode.addElement(pointElement);
String ename = s[pointIndex];
wdComponentAPI.getMessageManager().reportSuccess("name:"+ename);
pointElement.setStartValue(timeValues[seriesIndex][pointIndex][0]);
pointElement.setEndValue(timeValues[seriesIndex][pointIndex][1]);
pointElement.setCuId(pointCustomizing[seriesIndex][pointIndex]);
pointElement.setLabel(pointLabels[seriesIndex][pointIndex]);
pointElement.setToolTip(ename );
}
}
}
catch(Exception e)
{
wdComponentAPI.getMessageManager().reportSuccess("exc2:"+e);
}
By the above code ,I am getting the tool tip with the value "a" in all locations.
But I need to have different values in the tooltip corresponding to the location.
Please Help....
Thanks in advance,
Shamila
hi shamila,
which type of Business Graphics type (whteher columns or stacked columns or Gantt chart) used
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Now I am not getting the ClassCastException, I have changed my objects to IWDSeries....In IWDSeries class the is no method <b>series.setTooltip(series.getValue());</b>, so using which method should I assign value for the tooltip.
Please help, I want to get dynamic values in the tooltip of business graphics according to the graph coordinates....... by any way.....
Wating for your valuable inputs..............
Thanks in advance,
Shamila
hi,
I am using the method <b>setTooltip(String)</b> to set the tooltip of the business graphics ui element.I am getting the same value at all points in the graph.
But what I need is according to the x,y co-ordinates the value should be changing in the tooltip when the cursor is moved along the graph .How can this be achived?.............
Please help...............
Thanks in advance,
Shamila
Hi Shamila,
Check this link:
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9214b1e5-0601-0010-fdb0-ec32d43b06e0">UI Elements</a>
check page 82.there its clarified.
In general: The seriesSource property of the BusinessGraphics UI element is bound to a
context node superordinate to all context attributes that provide all relevant data for the data
series.
The pointSource property of the Series element must be bound to a context node that is
the child of the context node to which the seriesSource property of the BusinessGraphics
UI element is bound. All other bindable point element properties such as label and
tooltip must be bound to the context attributes that are children of the context node to
which the valueSource property of the Point element is bound.
The valueSource property of the Point element is bound to the same context node as the
pointSource property of the Series element. As a result, each point has the same number
of values. The value property of the TimeValue element must be bound to a context attribute
subordinate to the context node to which the valueSource property of the Point element is
bound.
I hope this will solve ur problem.
regards
Sumit
hi,
Still I am not getting the x, y coordinates in my tooltip...
Can you please tell me what should be the context node structure be?
The node structure which I am using now is ...
<b>Root Node</b>
><b>Category</b>>Description
><b>Series>Point</b>-->CuId
><b>Series>Point</b>-->endvalue
><b>Series>Point</b> -->Startvalue
><b>Series>Point</b> -->label
><b>Series>Point</b> --->Tooltip
In BusinessGraphis seriesSource-Series node ,tooltip-Series.Point.ToolTip is mapped
In Category description-Category.Description is mapped
In Series label-Series.Point.label,pointsource-Series.Point, tooltip-series.point.tooltip is mapped
In Point label-Series.label, tooltip-series.point.Tooltip,valuesource -series.point is mapped
In Timevalue value-series.point.startvalue is mapped
In Timevalue value-series.point.endvalue is mapped
I am using time value instead of numeric value ...
Please help me to get the co-ordinates of the graph in the tooltip..
Thanks in advance,
Shamila
hi,
My problem is not yet solved....
Can you tell me how to make use of the <b>eventid</b> property in the businessgraphics ui element in series ...
Through the event id property is there any way to get the cordinates in the tooltip of the businessgraphics ui element....
Please help...
Regards,
Shamila
hi shamila,
what r the nodes and attributes created and mapped please give this details..
Thanks,
P.Manivannan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
The nodes and attributes created and mapped are
Root Node
><b>Category</b>>Description
><b>Series</b>><b>Point</b>-->CuId
><b>Series</b>><b>Point</b>-->endvalue
><b>Series</b>><b>Point</b> -->Startvalue
><b>Series</b>><b>Point</b> -->label
><b>Series</b>><b>Point</b> --->Tooltip
In BusinessGraphis <b>seriesSource-Series</b> node ,<b>tooltip-Series.Point.ToolTip</b> is mapped
In Category <b>description-Category.Description</b> is mapped
In Series <b>pointsource-Series.Point</b>, <b>tooltip-series.point.tooltip</b> is mapped
In Point <b>label-Series.label</b>, <b>tooltip-series.point.Tooltip</b>,<b>valuesource -series.point</b> is mapped
In Numericvalue <b>value-series.point.startvalue</b> is mapped
In Numericvalue <b>value-series.point.endvalue</b> is mapped
When I place the cursor at a point on the graphical output,I should get the corresponding value in the tooltip at that point.
Now I am always getting the same value in the tooltip at all places.
Please help...........
Thanks in advance,
Shamila
hi,
Still I did not get the dynamic tool tip..........
In wdDoInit() I have written the following code
try
{
String[] catLabels = { "Team 1", "\1Tomoko Akino", "\1Hans Bosch", "\1Marvin Smith",
"Team 2", "\1Jose Vega", "\1Bao Yin", "Out of office" };
String[][] pointCustomizing = {
{ "approved", "cancelled", "approvedPartTime" },
{ "approved" },
{ "approved" },
{ "sent", "approvedPartTime", "notsentPartTime", "notsent"},
{ "approved", "zSeveralEntries", "zSeveralEntries",
"zSeveralEntries", "zSeveralEntries", "zSeveralEntries",
"zSeveralEntries" },
{ "outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
"outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
"outOfOffice", "outOfOffice", "outOfOffice", "outOfOffice",
"outOfOffice", "outOfOffice", "outOfOffice" } };
String[][] pointLabels = {{ " ", " ", " " },{ " " },{ " " },{ " ", " ", " ", " "},{ " ", " ", " ", " ", " ", " ", " " },
{ "1", "2", "2", "2", "4", "3", "3", "3", "1", "1", "2", "1", "2", "1", "1" } };
String[][][] timeValues = {{ { "20020528", "20020606" },
{ "20020606", "20020608" },
{ "20020610", "20020611" } },
{ { "20020531", "20020606" } },
{ { "20020607", "20020613" } },
{ { "20020527", "20020601" },
{ "20020606", "20020607" },
{ "20020612", "20020613" },
{ "20020617", "20020619"} },
{ { "20020531", "20020606" }, { "20020531", "20020601" },
{ "20020601", "20020602" }, { "20020602", "20020603" },
{ "20020603", "20020604" }, { "20020604", "20020605" },
{ "20020605", "20020606" } },
{ { "20020527", "20020528" }, { "20020528", "20020529" },
{ "20020529", "20020530" }, { "20020530", "20020531" },
{ "20020531", "20020601" }, { "20020603", "20020604" },
{ "20020604", "20020605" }, { "20020605", "20020606" },
{ "20020606", "20020607" }, { "20020607", "20020608" },
{ "20020610", "20020611" }, { "20020611", "20020612" },
{ "20020612", "20020613" }, { "20020617", "20020618" },
{ "20020618", "20020619" }} };
String s[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14",};
IPrivateSBusinessGraphicsSampleView.ICategoryNode catNode = wdContext.nodeCategory();
IPrivateSBusinessGraphicsSampleView.ICategoryElement catElement;
for (int catIndex = 0; catIndex < catLabels.length; ++catIndex)
{
catElement = catNode.createCategoryElement();
catNode.addElement(catElement);
catElement.setDescription(catLabels[catIndex]);
}
// loop over series
IPrivateSBusinessGraphicsSampleView.ISeriesNode seriesNode = wdContext.nodeSeries();
for (int seriesIndex = 0; seriesIndex < timeValues.length; ++seriesIndex)
{
IPrivateSBusinessGraphicsSampleView.ISeriesElement seriesElement = seriesNode.createSeriesElement();
seriesNode.addElement(seriesElement);
// set series attributes (...)
IPrivateSBusinessGraphicsSampleView.IPointNode pointNode = seriesElement.nodePoint();
IPrivateSBusinessGraphicsSampleView.IPointElement pointElement;
// loop over points
for (int pointIndex = 0; pointIndex < timeValues[seriesIndex].length; pointIndex++)
{
//IPrivateSBusinessGraphicsSampleView.IPointElement
pointElement = pointNode.createPointElement();
pointNode.addElement(pointElement);
String ename = s[pointIndex];
wdComponentAPI.getMessageManager().reportSuccess("name:"+ename);
pointElement.setStartValue(timeValues[seriesIndex][pointIndex][0]);
pointElement.setEndValue(timeValues[seriesIndex][pointIndex][1]);
pointElement.setCuId(pointCustomizing[seriesIndex][pointIndex]);
pointElement.setLabel(pointLabels[seriesIndex][pointIndex]);
pointElement.setToolTip(ename );
}
}
}
catch(Exception e){ wdComponentAPI.getMessageManager().reportSuccess("exc2:"+e); }
In wdDoModifyView() I have written the following code
try
{
IWDBusinessGraphics graph = (IWDBusinessGraphics)view.getElement("BusinessGraphics");
IWDAbstractSeries allSeries[] = graph.getSeriesList();
IWDSimpleSeries series;
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("length : "+allSeries.length+" value:"+allSeries[0]);
for(int j=0;j<allSeries.length;j++)
{
series = (IWDSimpleSeries)allSeries[j];
for(int i=0;j<wdContext.nodeSeries().size();i++)
{
wdContext.nodeSeries().setLeadSelection(i);
series.setTooltip(series.getValue());
}
}
}
catch(Exception e)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("exc modify :"+e);
}
The node structure is
Root Node
>Category>Description
>Series>Point-->CuId
>Series>Point-->endvalue
>Series>Point -->Startvalue
>Series>Point -->label
>Series>Point --->Tooltip
In BusinessGraphis seriesSource-Series node ,tooltip-Series.Point.ToolTip is mapped
In Category description-Category.Description is mapped
In Series pointsource-Series.Point, tooltip-series.point.tooltip is mapped
In Point CustomisingId-eries.point.cuId.label-Series.label, tooltip-series.point.Tooltip,valuesource -series.point is mapped
In Numericvalue value-series.point.startvalue is mapped
In Numericvalue value-series.point.endvalue is mapped
When I deploy my application I am getting <b>java.lang.ClassCastException</b> Exception at the line <b>series = (IWDSimpleSeries)allSeries[j];</b>
What is reaseon?.....
Please help..............
I want to get dynamic value in the tool tip of the graph.
Thanks in advance,
Shamila,
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.