ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Refreshing/update problems charts
Posted by Yorick B on Apr-04-2011 20:50
As you describe in you common problems FAQ:

3. My ChartDirector script does not work when I add some HTML to it.

You cannot mix any image with HTML. Instead, you should put an <IMG> in your HTML code. The <IMG> can then reference the script that generates your chart. This will embed your chart into your HTML document.

I have an image tag which references the c# method that sets all the chart data and returns a rendered image. Now i have a dropdown list that selects other data from the DB. this is done through a submit button.

I have the data also shown as text through viewdata, and once other data is selected through the dropdown list, the data shown as text adapts itself according to the set data. The charts however, don't. How can i get the charts to refresh their data properly? I call the image render methods again together with the viewdata text setting, so I don't get why the text does refresh, but the images won't.. I hope you know what I mean.

It would really help if someone would be able to explain this to me. Thanks!

  Re: Refreshing/update problems charts
Posted by Peter Kwan on Apr-05-2011 01:01
Hi Yorick,

In the ASP.NET sample code that comes with ChartDirector, the <IMG> tag usually is generated by the WebChartViewer. There is no need to explicitly put an <IMG> tag in the web page if you are using the WebChartViewer. (The advice to "put an <IMG> in your HTML code" is for other development framework, such as ASP or PHP, but not for ASP.NET.)

However, you can certainly use an <IMG> tag if you like. In this case, the update the chart, just reload the <IMG> tag. In the handler of the <IMG> tag, please redraw the chart using the selected data, and then stream the image back to the browser.

If you would need further help, please inform me of your code, so I may know the code structure you are currently using.

Hope this can help.

Regards
Peter Kwan

  Re: Refreshing/update problems charts
Posted by Yorick B on Apr-08-2011 20:12
Thanks for the fast response.

This is what i did though, and chartdirector doesn't want to be refreshed. I got it working now, though streaming through a memorystream is not an option. I have to save it as a temp file and include that file name in the url. This is the only option because hard refreshing etc won't work.