Jump to content
Software FX Community
Sign in to follow this  
hminky

HitTest - No series found in HitType_LegendBox

Recommended Posts

I made a MouseUp event.

void CDynamicDlg::OnMouseDownClientserver1(LPDISPATCH sender, LPDISPATCH args)

{

 Cfx62::_MouseEventArgsXPtr argsPtr;

 argsPtr = args;

 CString strY;

 int x = argsPtr->X;

 int y = argsPtr->Y;

 Cfx62::HitType type = argsPtr->_HitType;

 int series = argsPtr->Series;

 double value = argsPtr->Value;

When MouseDown at DataEditor, I can get correct HitType (HitType_DataEditor)  and series.

btw, MouseDown at LegendBox, I can get correct HitType (HitType_LegendBox)

but Series always return -1.

Is it a bug? (when I test with winforms version, it works)

 

Do you have any idea, how can I get Series number in Legendbox?

Share this post


Link to post
Share on other sites

You can get the index of the element in the legendbox by using the Point property, note that sometimes the legend box does show one element per point (e.g. in a pie chart) so it was kind of a coin toss. Looking backward we could have passed the same value in both Series and Point properties or try to pass the right property depending on what was being shown.

JuanC

Share this post


Link to post
Share on other sites

Point Works!

Thank you!

 

Two more questions

1. Can I move LegendBox to inside Chart?

LegendBox takes too much spaces but have to be shown.

Is there any way?

 

2. please give me an idea to show an selected state.

for example, if click series1 in legendbox,

I want to show "Series1 is selected" and ready to some action to "Series1".

can I border only series1? or something like that?

Can I get position and size of series1 in Legend box?

 

Highlight is not sufficient to me

when I mousemove to other position, highlight turns off.

 

 

Share this post


Link to post
Share on other sites

1. Can I move LegendBox to inside Chart?

No. There is no easy way to move the legend box inside the chart and still make sure it does not hide your data points, specially if the legend box is big.

2. please give me an idea to show an selected state.

Unfortunately ChartFX does not have the concept of selection on any of the items it plots (legend box, markers, etc.).

JuanC

Share this post


Link to post
Share on other sites

Dear,

I tried your suggestions and It worked.

but When I set invisible to some series,

the Point number is no longer means Series number.

 

for example, there are 0, 1, 2 series and I set Series1 to invisible,

(m_chartPtr->Series->Item[1]->Visible = FALSE;)

Point 0 means Series 0, but Point 1 means Series 2

so, I have to manage Series-Point number relations.

 

Is this bug or by design?

Is it fixed in CFX 2005?

TestChartFX.zip

Share this post


Link to post
Share on other sites

I would say is a bug but one that we will probably not fix as it could affect somebody relying on that behavior. I am afraid you will have to loop through the series and skip the invisible ones.

This was corrected in ChartFX for VS 2005 but we do not have a COM version of that product only .NET

JuanC

Share this post


Link to post
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.

Loading...
Sign in to follow this  

×
×
  • Create New...