Jump to content
Software FX Community

Translating e.X to X-axis series values


User (Legacy)

Recommended Posts

On an XY step graph - I need to be able to, in the MouseMove event of the

Chart, translate the e.X value into an X-Axis series value - is there an

easy way to do that? I know it's possible somewhere - if you set AllowDrag

to true and start dragging a point around, the tooltip that appears shows

the X-Axis series INTERPOLATED value as you move the point. What I mean by

"interpolated value" - my X series consists of date/times in one hour

intervals such as 9am, 10am, 11am, etc. As I drag a point in the X

direction, I'll see times like "9:12am", "9:19am", "10:26am" go by which

aren't actually within the X-series (very nice feature, btw).

Related to this - it would also be very nice if I could also get the Y-Axis

series value as well - in particular, if I could say "give me the Y-Axis

series value for e.Y for Axis(5) on the chart"; my charts have multiple

series on them.

--TG

Link to comment
Share on other sites

The Axis methods PixelToValue and ValueToPixel allow you to translate pixels

to and from Axis values, this works for both X and Y axes. Note that

PixelToValue always returns a double number so ...

a) If you invoke PixelToValue in a categorical axis (e.g. a bar chart where

bars are drawn equally spaced since X data was not provided) we will return

3.5 if the pixel you pass is in between 2 bars. Actually only the exact

horizontal center of the bar will return an integer number, multiple series

and space between the series make this a longer topic to discuss.

:) If you invoke PixelToValue in an axis that represent dates you will need

to use the DateTime.FromOADate method to translate the double number into a

DateTime variable.

Also note that if you have multiple Y axes you will have to decide which

axis to use (or all of them) to translate the pixel into a number.

--

Regards,

JC

Software FX Support

"TG" <timg@pgas.com> wrote in message

news:JZJyNLqCDHA.2752@webserver1.softwarefx.com...

> On an XY step graph - I need to be able to, in the MouseMove event of the

> Chart, translate the e.X value into an X-Axis series value - is there an

> easy way to do that? I know it's possible somewhere - if you set

AllowDrag

> to true and start dragging a point around, the tooltip that appears shows

> the X-Axis series INTERPOLATED value as you move the point. What I mean

by

> "interpolated value" - my X series consists of date/times in one hour

> intervals such as 9am, 10am, 11am, etc. As I drag a point in the X

> direction, I'll see times like "9:12am", "9:19am", "10:26am" go by which

> aren't actually within the X-series (very nice feature, btw).

>

> Related to this - it would also be very nice if I could also get the

Y-Axis

> series value as well - in particular, if I could say "give me the Y-Axis

> series value for e.Y for Axis(5) on the chart"; my charts have multiple

> series on them.

>

> --TG

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...