Skip to Content
author's profile photo Former Member
Former Member

Dynamic Values in Business Graphics Tool Tip

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 20, 2007 at 12:49 PM

    hi shamila,

    what r the nodes and attributes created and mapped please give this details..

    Thanks,

    P.Manivannan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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,

  • author's profile photo Former Member
    Former Member
    Posted on Jun 20, 2007 at 12:52 PM

    hi shamila,

    which type of Business Graphics type (whteher columns or stacked columns or Gantt chart) used

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.