Search code examples
c#asp.netpie-chart

ASP.NET - How to add hyperlinks to pie chart sections?


I have a pie chart that uses data returned from a business rules method. Is it possible to allow users to click on the segments of the pie chart by adding hyperlinks to each segment?

I know how to do this in the aspx of the pie chart, but the datasource and series of the data is based on the data returned from the method. Would you use something like: foreach series with a switch statement for the hyperlink?

How can I assign a hyperlink to the pie chart segments?


Solution

  • I worked out how to do this using a switch statement to assign a url and query string to specific segment names:

    Point.Url = "/url?querystring"