Getting the coordinates/ size of a bar chart element

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I wonder if anyone can help with this

I want to get the xy (ref the screen not the chart) coordintates and the
size of a bar chart element when I click on it.
I am using the mousedown event to get the element and can get at the element
itself, its data etc etc but I can't seem to find a way to get to indo about
its size and position on the screen (eg Top, Left etc).

Is this possible ?

Steve
 
Hey Steve -

When you get your XY, what are you going to do with it? There may be an
easier way to go about it.

- Jon
 
Jon

I have a drag and drop routine for individual elements of a stacked bar
chart - so that I can drag them (and the driving data) to different
places (ie a different order in the stacked bar or to a different
stack). One problem I have is that I want to create a rectangle exactly
the same size and position as the element selected so that this will be
visible during the drag operation.

I have now managed to achieve this by deducing the xy coords and the
size from the inside plot area property, the max point of the axis and
the cross over point, similarly for the category axis I have managed to
deduce what I want from the axis size and the parameter for bar spacing.
I can now create a rectangle with the mouse down event and can drag this
rectangle - driving the dotted line rectangle to be shown.

However, as always, I find a way to achieve what I want but not
necessarily the best way so if you know of anything I can do that is
better, quicker tidier I would appreciate your feedback.

Steve
 
Steve -

Sounds like you basically have done what I would have suggested. For
some things, there really isn't a "best way".

- Jon
 
Back
Top