With a lot of Series in the Chart,
if User Pickup a SeriesPoint, (not picked via ChartHitInfo)
how to get Series the SeriesPoint belong to?
Could the hidden Owner field became Public ?
How to get Series from a SeriesPoint
Answers
Hi Lin,
You should be able to use the ChartHitInfo.Series property to obtain the required information. Please try this approach and let us know if you need any clarification.
Thanks,
Alex
Alexander,
We will keep this scenario into account when discussing future ChartControl enhancements. Should you need further assistance, feel free to ask.
Hi,
It turns out that SeriesPoint implements ISeriesPoint which in turn has Owner property. Owner property is the Series.
Please make it as part of your documentation for when there is a need to access owner directly
Hi Alexander,
The ISeriesPoint interface belongs to the internal (Native) API. In general, we do not recommend including the Native namespace members in the production code, because the Native API is not documented and may change without any notification in the Breaking Changes list.
Hello Lin,
I am afraid your question is not clear to me. Could you please clarify this problem in greater detail? A step-by-step instruction with a sample project, demonstrating your goal, will be very helpful.
Thanks,
Constant
Public SeriesPoint getPointNearMouse(MouseEventArgs e)
{
Point pt = e.Location;
ChartHitInfo hitInfo = Chart.CalcHitInfo(pt);
SeriesPoint spt = hitInfo.SeriesPoint;
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X - 1, pt.Y); spt = hitInfo.SeriesPoint; }
else { return spt; }
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X + 1, pt.Y); spt = hitInfo.SeriesPoint; }
else { return spt; }
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X, pt.Y - 1); spt = hitInfo.SeriesPoint; }
else { return spt; }
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X, pt.Y + 1); spt = hitInfo.SeriesPoint; }
else { return spt; }
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X - 1, pt.Y - 1); spt = hitInfo.SeriesPoint; }
else { return spt; }
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X - 1, pt.Y + 1); spt = hitInfo.SeriesPoint; }
else { return spt; }
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X + 1, pt.Y - 1); spt = hitInfo.SeriesPoint; }
else { return spt; }
if (spt == null) { hitInfo = Chart.CalcHitInfo(pt.X + 1, pt.Y + 1); spt = hitInfo.SeriesPoint; }
else { return spt; }
return spt;
}