ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Axis tooltip not displayed
Posted by Lofi on Jul-05-2013 14:31
I have multiple axis, each can have multiple lines in them. I want to display a tooltip when the mouse is over the axis, with the chart lines as text in it. Better yet would be a legend box.

How can I achieve this? I can get the x/y coordinates of the mouse, even the axis itself that the mouse is over. But when I try showing e. g. a legend box like in the legend box tracking example, it doesn't work.

Just a guess: is it possible that the drawarea isn't created correctly when the mouse isn't over the plotarea?

Simple example which draws a black rectangle at the mouse position:

  private void trackBoxLegend(XYChart c, int mouseX, int mouseY)
  {
      DrawArea d = c.initDynamicLayer();

      int boxLeft = mouseX;
      int boxRight = mouseX+100;
      int boxTop = mouseY;
      int boxBottom = mouseY+100;

      d.rect(boxLeft, boxTop, boxRight, boxBottom, 0x000000, Chart.Transparent);
  }

It works in the trackcursorlistener, when the mouse is over the plotarea. Doesn't work when invoked in a mousemotionlistener.

Thank you very much for the help!

  Re: Axis tooltip not displayed
Posted by Peter Kwan on Jul-06-2013 03:42
Hi Lofi,

Have you called "viewer.updateDisplay();" as in the original sample code?

Regards
Peter Kwan