title: C# mouse click events on datapoints in a chart
body: <p>I want to create a chart and i am using the charts from the toolbox in Visual studio 2010. This is the first time i am trying to do this and so far i have learned the basics of the chart like how to create datapoints and add them to the series in order to get the chart. What i wanted to know is that if its possible to make the datapoints visible to the user (like the dots in a point chart) and the user to be able to click on a datapoint and get a specific result. What i was thinking is that since i am creating the datapoint is there an option to make it "clickable" or do i have to create seperate mouseclick events for every datapoint. Excuse me for my ignorance but i am new to this. Where can i find a guide that will help me to create the chart.
  Here is a part of my code so far:</p>
  
  <pre><code>chart1.Series[0].IsVisibleInLegend = false;
  chart1.Series[0].ChartType = SeriesChartType.FastLine;
  
  DateTime sday = Convert.ToDateTime(earnings1.dataGridView1[0, 0].Value.ToString());
  chart1.Series[0].XValueType = ChartValueType.String;
  int i = 0;
          foreach (DataGridViewRow dgvr in earnings1.dataGridView1.Rows)
          {
              decimal testing = Convert.ToDecimal(earnings1.dataGridView1[1, i].Value);
              testing = decimal.Truncate(testing);
  
              var point = new DataPoint(i+1, Convert.ToDouble(testing));
  
              point.Label = testing.ToString();
              point.Font = new Font("Century Gothic", 8, FontStyle.Bold);
              chart1.Series[0].Points.Add(point);
              chart1.Series[0].Points[i].AxisLabel = sday.ToString("dd/MM/yyyy");
              sday = sday.AddDays(1);
              i++;
            }
  </code></pre>
  
  <p>what i am doing is that i have a datagridview with 2 columns. One with the date and the other column with a decimal number. I created a chart with the dates on the x axis (custom labeled since the dates are from a mysql database and the format is yyyy:mm:dd and i convert it to dd/MM/yyyy) and on the y axis the values. I am creating a datapoint a each day with its value aand i plot them on the chart. How can i click now on the points so that for example when i click on the value at 24/May/2012 to do something like show some other information from the database at that specific date.
  Thank you in advance for your support, any help will be truly appreciated.
  Sincerely
  George Georgiou</p>