Solved

How to respond to ASP chart control click event

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now