currently i m workin on Ms CHarts wid VB.NET
nd create a chart sucessfully bt nw i wnt to click on that particular bar of that chart nd want to get that particular axis label of that bar ..

Private Sub ChartMonthWiseSalary_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles ChartMonthWiseSalary.MouseDown
Dim htrResult As HitTestResult = ChartMonthWiseSalary.HitTest(e.X, e.Y)
If htrResult.PointIndex >= 0 Then
If htrResult.ChartElementType = ChartElementType.DataPoint _
Or htrResult.ChartElementType = ChartElementType.LegendItem Then
Me.Cursor = Cursors.Hand
Dim dpSelected As DataPoint
dpSelected = ChartMonthWiseSalary.Series(0).Points(htrResult.PointIndex)
dpSelected.BackSecondaryColor = Color.Black
dpSelected.BorderColor = Color.White
dpSelected.BorderWidth = 1
Label2.Text = htrResult.PointIndex.ToString
Label3.Text = htrResult.Series.ToString
Month = ChartMonthWiseSalary.Series(htrResult.Series.Name).Points(htrResult.PointIndex).AxisLabel

            End If

        Else

            'Set cursor back to default when leaving selected datapoint
            Me.Cursor = Cursors.Default
        End If

done solved ....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.