Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MSChart Mouse
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 21:23pm

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

  Print Answers RSS
0 OriginalGriff 270
1 Sergey Alexandrovich Kryukov 185
2 BillWoodruff 173
3 CPallini 155
4 Kamal Rocks 144
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 24 Apr 2013
Copyright © CodeProject, 1999-2014
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