Jump to content
Software FX Community

Get values from point that is clicked


User (Legacy)
 Share

Recommended Posts

I am using Chartfx Client Server 5.0.6.0

I am new to Chartfx so I may not use the proper terms (please correct me if

I am wrong.)

I am trying to create a drill-down on my charts. What I need to do is get

the values of the series item & x-axis item that the user clicked on.

Is there a way to do this?

Thanks

Daniel Reber

Datamasters, Inc

Link to comment
Share on other sites

Thanks, but I still am not 100 % sure on what to do.

Here is my code so far:

Private Sub mChart_LButtonDblClk(ByVal x As Integer, ByVal y As Integer,

ByVal nSerie As Integer, ByVal nPoint As Long, nRes As Integer)

Dim eHit As ChartfxLibCtl.CfxHitTest

eHit = mChart.HitTest(x, y, nSerie, nPoint)

If eHit = HIT_AXISX Then

mChart.PixelToValue ' What do I do here? Where do I get the rest of

the arguements?

End If

End Sub

mChart.PixelToValue <--What do I do here? Where do I get the rest of the

arguements? Is this the correct method to use?

Am I even close?

Thanks

Daniel Reber

Datamasters, Inc

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:YRXdBsKOCHA.3520@webserver1.softwarefx.com...

> You can use HitTest to retrieve the Series and Point index of a particular

> Pixel position, the you can uses these indexes to retrieve any other

> information from the chart such as labels, values, etc.

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

In particular in LButtonDblClk you already have the Series and Point index

(ByVal nSerie As Integer, ByVal nPoint As Long) so you don't need to call

HitTest.

PixelToValue receives the Pixel position which you have as parameters (ByVal

x As Integer, ByVal y As Integer) and it return the logical X and Y value

into 2 double variables.

Dim dx As Double

Dim dy As Double

ChartFX1.PixelToValue x, y, dx, dy, AXIS_Y

If both nSerie and nPoint are > 0 (you hit a point) the you can also use

the indexes to retrieve info from that point for example:

ValueOfPointClicked = Chart1.ValueEx[nSerie,nPoint]

LabelOfPointClicled = Chart1.Legend[nPoint]

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...