NHitTestResults and ChartElement.DataPoint No Longer Works


Author
Message
Timothy Dishop
Timothy Dishop
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 10, Visits: 63
We have an old method that used to search for a DataPoint and then display that position on the chart.  DataPoint is no longer found.  Has something changed about how data points are added.

Here's the code:

  private void OnValueChanged(object sender, EventArgs e)
   {
    var xAxisValue = DateTime.FromOADate(_chartHorizontalAxisCursor.Value);
    double yAxisValue = _chartVerticalAxisCursor.Value;
    NHitTestResult hitTest = _chartControl.HitTest(_mouseXPoint, _mouseYPoint);
    if (hitTest.ChartElement == ChartElement.DataPoint)
    {
      if (GetChartCategory(_resultsViewInfo.ChartType) == ChartCategory.Column)
      {
       toolTip1.SetToolTip(_chartControl, "Y:" + yAxisValue.ToString("N"));
      }
      else
      {
       toolTip1.SetToolTip(_chartControl, "X:" + xAxisValue.ToString("MMM dd hh:mm:ss tt") + ", Y:" + yAxisValue.ToString("N"));
      }
    }
    else
    {
      //toolTip1.SetToolTip(_chartControl, "JR");
      toolTip1.SetToolTip(_chartControl, "Y:" + yAxisValue.ToString("N"));
    }
   }



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search