Get a value out off a chart just by a mouse click

R

Rody

Is it possible to get the value of the X-ax out of a chart just by clicking
in the chart? What i want is to zoom in on a given chart area by clicking on
the start and stop range. If i have the X-ax value's, (it's a time stamp), i
can select the new source for the "zoomed" chart.

Any ideas?

Grtz,
rody
 
G

Guest

Charts have events, including a MouseDown event, that could be used to trap a
mouse click and determine the location - as x and y values representing
distance from the upper left corner of the ChartArea (not to be confused with
any coordinates used in your chart). But to use this to find a specific and
accurate point using your chart coordinates would be quite difficult in
practice, I would think, since there are multiple (and variable) scaling
factors involved (what is the size and location of the PlotArea? Then what
type of chart is it? Where is the origin of the axes? What scale are you
using currently in the chart...). You would need to develop a custom class
to do all of this; seems to me it would be quite difficult!
 
S

Stephen Bullen

Hi Rody,
Is it possible to get the value of the X-ax out of a chart just by clicking
in the chart? What i want is to zoom in on a given chart area by clicking on
the start and stop range. If i have the X-ax value's, (it's a time stamp), i
can select the new source for the "zoomed" chart.

Any ideas?

Sure. See Chapter 15 from PED, available for download on my web site, which
shows how to convert between mouse click coordinates to data coordinates.

Regards

Stephen Bullen
Microsoft MVP - Excel

Professional Excel Development
The most advanced Excel VBA book available
www.oaltd.co.uk/ProExcelDev
 
R

Rody

Tanks!!!

Rody



Stephen Bullen said:
Hi Rody,


Sure. See Chapter 15 from PED, available for download on my web site,
which
shows how to convert between mouse click coordinates to data coordinates.

Regards

Stephen Bullen
Microsoft MVP - Excel

Professional Excel Development
The most advanced Excel VBA book available
www.oaltd.co.uk/ProExcelDev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top