2

Can anybody give a code snippet which will explain how to use Binary streaming render type in ASP.Net Charting controls using $.ajax call in ASP.Net MVC Framework. ?

Ajax call will look like this-->

$.ajax({              

    type: "POST",

    url: "/DrawChart/" + drawingParamter1+ "/" + drawingParamter2,

    dataType: someSuitableDataType,

    error: function(error) {

    },

    success: function(html) {

    }
});
Kushal Waikar
  • 2,976
  • 5
  • 26
  • 31

3 Answers3

1

I am not sure why do you want to use ajax to call a binary stream, but this blog post shows you how to do the binary stream using or using a control.

http://setiabud.blogspot.com/2010/02/using-aspnet-chart-controls-in-aspnet.html

Johannes Setiabudi
  • 2,057
  • 17
  • 29
  • I need to draw chart through an asynchronous call. My chart takes 1-2 minutes or sometimes 5 minutes to get drawn. I wish to show loading indicator for the time frame in which chart is being drawn. So I think it is possible through Ajax call(ajaxStrat() & ajaxStop() methods). Please correct me if I am wrong. – Kushal Waikar Mar 02 '10 at 03:18
  • Why not just save the images as files on the server and then retrieve them? – Johannes Setiabudi Mar 02 '10 at 15:29
1

You might want to take a look at these links:

http://msdn.microsoft.com/en-us/library/dd456682.aspx http://support2.dundas.com/OnlineDocumentation/WebChart2005/ImageMaps_ImageMapBinary.html

Found it after a lot of searching.

Roy
  • 11
  • 1
0

The dundas link is quite dated, requiring the chart control to be duplicated in the content page, and also in the handler page. A really slick (and easy) way that takes a bit of reading to fully understand is to use an img tag in the content page with imageUrl pointing to the handler page, and adding query string at runtime passing in any required parameters.

You have 2 options for the handler page - either an ashx, or an aspx page containing no markup except for the chart control. This 2nd method makes it easy to style certain elements of the chart in the designer, and wire up the rest at runtime.

See link asp.net:Invalid temp directory in chart handler configuration [c:\TempImageFiles\] (and in particular, scroll down to reply by Stefan Steiger) and also https://web.archive.org/web/20201205231110/https://www.4guysfromrolla.com/articles/081909-1.aspx (a little bit out of date).

Community
  • 1
  • 1
user3085342
  • 86
  • 1
  • 6