Click here to Skip to main content
13,087,941 members (65,182 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am using MsChart control for a charting application. In that, i am using MouseMove event to display the x-axis dynamic data on graph. Code snippet is as below -

try { //if(EventChart.ChartAreas[0].AxisX.PixelPositionToValue(e.Location.X) == EventChart.Series[0].ChartArea) if (e.Location.X < 0) cursorX = EventChart.ChartAreas[0].AxisX.PixelPositionToValue(0);
                    cursorX = EventChart.ChartAreas[0].AxisX.PixelPositionToValue(e.Location.X);
            cursorY = EventChart.ChartAreas[0].AxisY.PixelPositionToValue(e.Location.Y);
            tipInfo = "Date: " + DateTime.FromOADate(cursorX);
            DataPoint x = new DataPoint(cursorX, cursorY);
                //for (int i = 0; i < 39; i++)
                //    //bool status = EventChart.Series[i].Points.Contains(x);
                //    if (EventChart.Series[i].Points[Convert.ToInt16(EventChart.ChartAreas[0].CursorX.Position)].ToString() != null)
                //    {
                //        tipInfo += "\n" + GraphSeries[i];
                //        break;
                //    }
            tooltip.UseFading = true;
            tooltip.SetToolTip(EventChart, tipInfo);
            tooltip.Show(tipInfo, EventChart);

The problem i am facing is that, the mouse move event is getting called, whenever i get into the area where the data is to be displayed, this code updates the x- axis data only for particular left region of my chart. And it does not update x-axis data at tooltip for rest of part of chart.
Posted 23-Apr-13 20:23pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100