Solved

How to respond to ASP chart control click event

Posted on 2014-01-17
3
1,362 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
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

786 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