Hi
Could someone help me with the ChartImagesPath property of the UltraChart control (NetAdvantage for ASP.NET 2008 Vol 2).
I've tried modifying the properties of the control from the code behind (e.g. UltraChart1.ChartImagesPath = @"c:\mydirectory"; or... Chart1.ChartImagesPath = "mydirectory";), from the aspx source and from the properties page of the control and every time the control just uses the default of "ChartImages" in the root of the application directory.
If I look at the path to the rendered chart image it always points to the "ChartImages" directory and if I rename this directory the application crashes out saying "Error: Sys.WebForms.PageRequestManagerSErverErrorException: Could not find a part of hte path 'c:\inetpub... ...\ChartImages". I wish to use the control in a SharePoint site using SmartPart therefore I need to specify a directory elswhere for ChartImages.
Thanks
Andy
That property is for scrollbar and crosshair images:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.WebUI.UltraWebChart.v8.2~Infragistics.WebUI.UltraWebChart.UltraChart~ChartImagesPath.html
Instead you want to set the properties under UltraChart1.DeploymentScenario.
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.WebUI.UltraWebChart.v8.2~Infragistics.WebUI.UltraWebChart.WebDeploymentScenario_members.html
Do you have a C# example? Why am I looking at WebDeploymentScenario when there's no DeploymentScenario on it?
is this correct?
DeploymentScenario.Scenario = ImageDeploymentScenario.FileSystem;
And which is correct here?
mychart.DeploymentScenario.FilePath = @"\ChartImages\"
mychart.DeploymentScenario.FilePath = @"/ChartImages/";
Hi Greg,
I was having the same issue. The way I got it working was to use the design view of the ASPX page that the UltraWebChart was on and configure the DeploymentScenario in the Properties window. It was fairly straight-forward. The only real issue I had was using "~/" for "go up one directory" didn't work, so I used "../" instead. Here is what it looked like in code:
<DeploymentScenario FilePath="../images/temp/chart" ImageURL="../images/temp/chart/Chart_#SEQNUM(100).png" />
Hope that helps.
Peter
Lenos Software
the issue with the tilde character (~) in the ImageURL was logged as bug # 20022 and fixed on 7/27. it will be resolved in an upcoming service release.
I tried both "~/ChartImages" and "../../../ChartImages" and it doesn't work. It does find the right directory and saves the file there but then renders the <img> tag with the "src" attribute pointing elsewhere. How do i resolve that?
PS. Until there is an answer, if anybody else has this problem, you can override RenderChildren() in your container (Page or UserControl) like this:
protected override void RenderChildren(HtmlTextWriter writer) { StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); base.RenderChildren(hw); writer.Write(sw.ToString().Replace("src=\"ChartImages", string.Format("src=\"{0}", ResolveUrl("~/ChartImages")))); }
PPS. The above doesn't work with partial postbacks. Besides, string.Replace is slow. A better solution is to change the "src" attribute by locating the <img> tag using Javascript. Implementation of that differs depending on the framework that's in use.