ASP.Net chart control not working properly in IE 9.0
I've used ASP:Chart control in my web application and it was working fine until i upgraded my browser from IE 8.0 to 9.0.
Now almost every time i come to the pages with some chart controls in them, the picture won't be rendered, but if i refersh the page it always renders the images properly.
So i did some research and made some changes to my "ChartImageHandler" key in开发者_JAVA技巧 web config. now it is something like this :
[chart Images folder] points to a folder inside my web app with full permission for my app pool user (In fact just for testing i gave full permission to everybody, definitely not a permission problem).
The problem is i do not have any problems with Firefox, Safarai, chrome or even older versions of IE, the problem happens only in IE 9.0 (BTW if i switch to compatibility mode in IE 9.0 it works fine).
When trying to watch this page using IE 9.0 i can see that chart images will be created in that folder, but they won't be removed, but using any other browser, those files are created and then removed without any problem.
I tried "storage=session" or "storage=memory" , no luck, although i'm sure i can not use "memory" because it's supposed to be deployed on a multi web server platform (Load balancers and stuff).
unfortunately most users are using IE 9.0 and i can not force them to use another browser or switch to compatibility mode.
I would appreciate your help guys.
try to add ImageStorageMode="UseImageLocation" to your chart. so the chart wil look like
<asp:Chart ID="Chart1" runat="server" DataSourceID="drawChartObjectDataSource" Height="200px"
Width="800px" EnableViewState="True" ImageStorageMode="UseImageLocation">
and then go to your web.config and add AppSetting
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=400;dir=c:\TempImageFiles\;" />
</appSettings>
note the location of the stored images C:\TempImageFiles\ MUST BE EXSIT
Thanks I hope its solve the problem
I had exactly the same problem and I solved it.
My webpage where the asp:chart control was located has a masterpage reference
MasterPageFile="~/MasterPage.master"
In the masterpage i have some .js and .css references.
I solved this changing the order of the references (you have to reference first the javascript code)
I don't know why this is happening, IE 9.0 stuff.
Use fusion chart or zed chart
http://www.fusioncharts.com/
http://www.codeproject.com/KB/graphics/zedgraph.aspx
I have solved the issue by adding deleteAfterServicing=false parameter to the image handler in web.config. e.g.
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=400;dir=c:\TempImageFiles\;deleteAfterServicing=false;" />`
</appSettings>`
Please note that using this method the images will not be removed after servicing as the name of the parameter suggests. This means that you will have to manage that yourself.
精彩评论