Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Hyperlinks to Data Point Labels for Line Chart 1

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
0
0
US
Hello,

I'm using the ASP.NET Charting Controls with the NET 4.0 framework. I've been looking through the interactive samples and have figured out how to implement a line chart with the data point labels, but have been unable to find a solution for adding a hyperlink to these labels. The purpose is to enable the user to click on a data point label and be taken to a gridview which is populated with detail level data.

Any help or point in the right direction would be greatly appreciated!

Thanks,
Larry

 


Not sure if it what you want, but you can set the PostBackValue of the series to the index of the data point along with the X and Y values. Handle the postbback in the chart.Click handler.

Code:
Series.IsValueShownAsLabel = True
Series.PostBackValue = "#INDEX|#VALY|#VALX"

Private Sub Chart_Click(sender As Object, e As System.Web.UI.WebControls.ImageMapEventArgs) Handles Chart1.Click
        Debug.Print(e.PostBackValue)
End Sub




Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Hi Mark,

Thanks for your reply. Actually, what I'm looking for is an actual hyperlink that I can pass input parms to (from the Request object). This will supply the necessary parms to a stored procedure that fires to get the detail level data in the grid.

Hope that makes sense.

Thanks,
Larry
 
If you mean the the Request.QueryString, you can add this to your code too:

Code:
Series.LabelUrl = "[URL unfurl="true"]http://yourWebSite/yourPage.aspx?N="[/URL] & Series.Name & "&Y=#VALY&X=#VALX"


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Ahhhh, I see. Let me work with this and let you know. Appreciate the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top