Profile Picture

NHitTestResults and ChartElement.DataPoint No Longer Works

Posted By James Richason 5 Years Ago

NHitTestResults and ChartElement.DataPoint No Longer Works

Author
Message
James Richason
Question Posted 5 Years Ago
View Quick Profile
Forum Newbie

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
Last Active: 5 Years Ago
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"));
    }
   }







Similar Topics


Reading This Topic