Dynamic ImageMap for MS Chart control in ASP.NET MVC RRS feed

  • Question

  • Hello,

    I am currently using the MS Charts controls in my ASP.NET MVC application to create Bar/Pie Charts and see that there is no facility to provide "clickable regions" in my charts (for drill-down charts). Hence, I would like to add an ImageMap for the image created by the chart control. To this end, I would like to know of a way to dynamically identify the co-ordinates (of rectangular regions) in the chart image. Please let me know your thoughts on how one can achieve this.


    Monday, August 24, 2009 4:02 PM


All replies

  • If you want to track clicks on the data points, check Url, PostBackValue and MapAreaAttributes properties. If you want to create a clickable area which is not aligned with any chart element, then consider using Chart.MapAreas collection.

    Monday, August 24, 2009 4:35 PM
  • Alex,

    Thanks for the response. Though I did not understand the phrase "...clickable area which is not aligned with any chart element", I went ahead and consulted the documentation for the MapAreas collection and it contains the following point:

    "If you render the chart as a binary stream, a special technique must be used to implement client-side image maps."

    But there is no mention of what that special technique is. Any further pointers?

    Just to re-iterate, my intention is to generate a Bar chart with each bar acting as a hyperlink, clicking on which will request the server to generate another chart (that drills down on the details of the clicked bar). So, I would presume, the control needs to have an ImageMap with the regions defined for each bar and the URL of the region providing pointers to the server on which bar is being clicked.




    Tuesday, August 25, 2009 1:38 PM
  • In that case I recommend you to check the DrillDown samples in Chart Sample Envirenment. You can download it here: http://code.msdn.microsoft.com/mschart

    Tuesday, August 25, 2009 3:55 PM