Ticket Q319047
Visible to All Users

How to get Series from a SeriesPoint

created 14 years ago

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 ?

Comments (2)
DevExpress Support Team 14 years ago

    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

      1. In Chart Mouse Down Event, I use function below (getPointNearMouse) to get a data point:
      2. if I get a SeriesPoint from that function, how to identify which Series owns the SeriesPoint in later codes?
      3. In debug mode, I found a Owner field exist in SeriesPoint, could it became public, so that I could use it to access relative Series.
                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;
                }

      Answers

      created 14 years ago

      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

        Show previous comments (15)
        DevExpress Support Team 6 years ago

          Alexander,

          We will keep this scenario into account when discussing future ChartControl enhancements. Should you need further assistance, feel free to ask.

          AG AG
          Alexander Gurevich 6 years ago

            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

            DevExpress Support Team 6 years ago

              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.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.