Solved

How to respond to ASP chart control click event

Posted on 2014-01-17
3
1,503 Views
Last Modified: 2014-01-26
I have a chart control that looks like the embedded picture.  What I need to do is click on the account description on the chart, and have it change the account combo box on the bottom or better yet get rid of the combo box and just click on the chart account description and have it update the data grid with the new data.  Just not sure how to capture which description was clicked if that's possible, so I can do the rest of the code to fill the grid.

thanks in advance


chart control sample
0
Comment
Question by:mgmhicks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39790411
Hi,
assuming you use the .NET 3.5 chart control, you can set image maps onto the chart elements.
Some good examples are available on codeplex in the charting controls library:
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=1591

Run the sample web site and go to the interactivity section.

HTH
Rainer
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 39809876
Not sure if this is the way they do it in the samples, but this works for me:
    Private Sub Chart1_Customize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Chart1.Customize
        For Each lbl As CustomLabel In Chart1.ChartAreas(0).AxisX.CustomLabels
            lbl.PostBackValue = lbl.Text
        Next
    End Sub

    Private Sub Chart1_Click(sender As Object, e As System.Web.UI.WebControls.ImageMapEventArgs) Handles Chart1.Click
        DoSomethingWith(e.PostBackValue) ' the text of the label that was clicked
    End Sub

Open in new window

0
 

Author Closing Comment

by:mgmhicks
ID: 39810953
thanks, that will work
0

Featured Post

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Call to SQL server times out 5 55
Convert a string to date 4 40
vb.net code 9 29
Help with changing file extension from TIFF to PNG using VB.NET 15 26
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question