User (Legacy) Posted January 30, 2004 Report Share Posted January 30, 2004 Hi, In my last post I had asked how I could create a user control from the chart. The response I got was that I could do this if I used the PSS extension. I have installed the PSS extension and created a pretty simple usercontrol that has a chart and populates it with some simple data. I have a webform that displays the user control. Problem: 1) The chart is being populated with data but for some reason the chart displays a graph that doesn't correspond to it's datasource. 2)Everytime I refresh the page the chart displays a different graph(ie different data points). Just to check I wasn't doing anything wrong and I have the PSS extension installed correctly, I have a working example of a webform that displays a chart using the PSS outputwriter. So it seems that only when I build a usercontrol it doesn't seem to work. I am using the latest versions of all the dll's including service pack up dates. Please find attached code. Also another issue I have noticed is that refreshing a page that contains chart using the PSS outputwriter takes over 3 seconds to reload. Is this always the case? Is this to do with IIS buffering and delayed chart generation? How can I improve performance? I have been using your windows forms charts for quite a while and really haven't had any trouble using them. Unfortunately I haven't had quite the same experience with the Web Forms controls. Would be great if someone can give answers to all my questions. Any help much appreciated. Thanks Sumesh Link to comment Share on other sites More sharing options...
Software FX Posted February 3, 2004 Report Share Posted February 3, 2004 >1) The chart is being populated with data but for some reason the chart > displays a graph that doesn't correspond to > it's datasource. We have been unable to reproduce this problem. You are building a WebForms user control (in your server) that uses Chart FX. Then You put this control in a form right, then what ? how and when do you pass the data to the control ? Can you send a sample project that reproduces the problem you are describing ? It seems to me that something is missing from your code. > 2)Everytime I refresh the page the chart displays a different graph(ie > different data points). Hitting Refresh will make your ASPX page to run again, so it depends on what you do in your page. What happens when you refresh the test page that you did using the PSS extension ? does it also take 3 seconds ? how long does it take for a page containing a static image of about the same size to refresh ? -- FP Software FX Link to comment Share on other sites More sharing options...
User (Legacy) Posted February 4, 2004 Author Report Share Posted February 4, 2004 Thanks for getting back. Problem #1 I have attached a sample project that consists of a user control that uses Chart FX and a webform. In the page load of the user control I populate the chart with some dummy data and use the pss extension. I have put this user control onto a webform. That's it...tried to keep it as simple as possible. Run the project and keep refreshing the page, you will notice that the data points of the chart keep changing with every refresh and doesn't correspond to it's datasource. In my project : Name of user control = chartPssUserControl.ascx Name of web form = MainForm.aspx Problem #2 I have a webform that contains chartFX. On page load I am using the pss extension and populating the chart with some dummy data. When I refresh the page it takes almost 2 to 3 seconds for the page to reload. A static image of the same size refreshes almost instantly. Please find the sample in the attached project. Name of web form=SlowForm.aspx Hope that helps...let me if you have any other questions. Thanks Sumesh "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:twY6Smp6DHA.2336@webserver3.softwarefx.com... > >1) The chart is being populated with data but for some reason the chart > > displays a graph that doesn't correspond to > > it's datasource. > > We have been unable to reproduce this problem. > > You are building a WebForms user control (in your server) that uses Chart > FX. Then You put this control in a form right, then what ? how and when do > you pass the data to the control ? > > Can you send a sample project that reproduces the problem you are describing > ? > > It seems to me that something is missing from your code. > > > 2)Everytime I refresh the page the chart displays a different graph(ie > > different data points). > > Hitting Refresh will make your ASPX page to run again, so it depends on what > you do in your page. What happens when you refresh the test page that you > did using the PSS extension ? does it also take 3 seconds ? how long does it > take for a page containing a static image of about the same size to refresh > ? > > -- > FP > Software FX > > Link to comment Share on other sites More sharing options...
Software FX Posted February 5, 2004 Report Share Posted February 5, 2004 I think you are a little confused about how Web Forms work. When you drop a control at design time (like you do for both the Chart and Your Own control on the form) the control will be created at run-time and add it to the Control Tree. This is done PRIOR to Page_Load. In your code you have: private void Page_Load(object sender, System.EventArgs e) { chartPssUserControl1 = new chartPssUserControl(); chartPssUserControl1.genChart(); } This is basically creating a SEPARATE chartPssUserControl that is not linked to the form at all. You should just REMOVE this code. Furthermore, in the User Control code, you make the same mistake: When you do: Chart1 = new SoftwareFX.ChartFX.Internet.Server.Chart(); You are creating again a separate chart object that is not linked to your user control, and this is the chart object you are setting data and properties to, you are leaving the chart object in your control "untouched:. By removing this line you will fix this problem. -- FP Software FX pssproblems.zip pssproblems.zip Link to comment Share on other sites More sharing options...
User (Legacy) Posted February 5, 2004 Author Report Share Posted February 5, 2004 Thanks for pointing that out....It's working now. Now I am still having the performance issues. It takes about 2 seconds when the page is refreshed. Is there some sort of setting I need to change? Thanks Sumesh "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:$ctW6$$6DHA.2152@webserver3.softwarefx.com... > I think you are a little confused about how Web Forms work. > > When you drop a control at design time (like you do for both the Chart and > Your Own control on the form) the control will be created at run-time and > add it to the Control Tree. This is done PRIOR to Page_Load. > > In your code you have: > > private void Page_Load(object sender, System.EventArgs e) > { > chartPssUserControl1 = new chartPssUserControl(); > chartPssUserControl1.genChart(); > } > This is basically creating a SEPARATE chartPssUserControl that is not linked > to the form at all. > > You should just REMOVE this code. > > Furthermore, in the User Control code, you make the same mistake: > > When you do: > > Chart1 = new SoftwareFX.ChartFX.Internet.Server.Chart(); > > You are creating again a separate chart object that is not linked to your > user control, and this is the chart object you are setting data and > properties to, you are leaving the chart object in your control "untouched:. > By removing this line you will fix this problem. > > -- > FP > Software FX > > Link to comment Share on other sites More sharing options...
Software FX Posted February 5, 2004 Report Share Posted February 5, 2004 How long does it take if you take out the chart ? You have a loop there setting values and stuff plus both the page and the image have to be served to the client 2 seconds doesn't seem like a long time to me. If you want to activate caching, please take a look at the PSS Extension programmer's guide located under "Chart FX Extensions" in the Chart FX for .NET Help File. You need to do something like this: Dim ts As New TimeSpan(0, 7, 0) pssWriter.ExpirationTime = ts -- FP Software FX Link to comment Share on other sites More sharing options...
User (Legacy) Posted February 6, 2004 Author Report Share Posted February 6, 2004 Yes I do have a loop, but a loop with 20 iterations will no way effect the performance. The performance hit is definitely caused by the creation of the chart. I have turned on caching but that seems to make no difference. Even using the bit streaming method "GethtmlData" seems to be much faster that using the pss extensions. From your documents you seem to suggest that the pss approach is much faster although it doesn't seem to be the case. Can someone explain why this is the case? 2 seconds to load a chart with little data is definitely not efficient at all. Looking forward to hear your thoughts. Sumesh "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:29gRtCD7DHA.2336@webserver3.softwarefx.com... > How long does it take if you take out the chart ? > > You have a loop there setting values and stuff plus both the page and the > image have to be served to the client 2 seconds doesn't seem like a long > time to me. > > If you want to activate caching, please take a look at the PSS Extension > programmer's guide located under "Chart FX Extensions" in the Chart FX for > .NET Help File. > > You need to do something like this: > > Dim ts As New TimeSpan(0, 7, 0) > pssWriter.ExpirationTime = ts > > > -- > FP > Software FX > > > Link to comment Share on other sites More sharing options...
Software FX Posted February 6, 2004 Report Share Posted February 6, 2004 Have you tried to pinpoint what is taking 2 seconds, e.g. comment everything but the chart creation, etc. Have you checked View-Source to see if in fact the PSS extensions are being used ? -- Regards, JC Software FX Support "Sumesh" <sumesh.nair@flytxt.com> wrote in message news:i7YL0VM7DHA.2468@webserver3.softwarefx.com... > Yes I do have a loop, but a loop with 20 iterations will no way effect the > performance. The performance hit is definitely caused by the creation of the > chart. I have turned on caching but that seems to make no difference. Even > using the bit streaming method "GethtmlData" seems to be much faster that > using the pss extensions. From your documents you seem to suggest that the > pss approach is much faster although it doesn't seem to be the case. > > Can someone explain why this is the case? 2 seconds to load a chart with > little data is definitely not efficient at all. > > Looking forward to hear your thoughts. > Sumesh > > > > "SoftwareFX Support" <noreply@softwarefx.com> wrote in message > news:29gRtCD7DHA.2336@webserver3.softwarefx.com... > > How long does it take if you take out the chart ? > > > > You have a loop there setting values and stuff plus both the page and the > > image have to be served to the client 2 seconds doesn't seem like a long > > time to me. > > > > If you want to activate caching, please take a look at the PSS Extension > > programmer's guide located under "Chart FX Extensions" in the Chart FX for > > .NET Help File. > > > > You need to do something like this: > > > > Dim ts As New TimeSpan(0, 7, 0) > > pssWriter.ExpirationTime = ts > > > > > > -- > > FP > > Software FX > > > > > > > > Link to comment Share on other sites More sharing options...
Software FX Posted February 6, 2004 Report Share Posted February 6, 2004 Also, is the PSS Service running ? Can you please check this in your services (Administrative tools). Also, do a View Source on the resulting HTML page and check where is the image source pointing to ? is it pointing to a service ? can you please post that HTML tag. -- FP Software FX Link to comment Share on other sites More sharing options...
User (Legacy) Posted February 9, 2004 Author Report Share Posted February 9, 2004 Hi, Yes my Pss service is running. Here is the HTML tag that is being generated: <HTML> <HEAD> <title>WebForm1</title> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </HEAD> <body MS_POSITIONING="GridLayout"> <form name="Form1" method="post" action="MainForm.aspx" id="Form1"> <input type="hidden" name="__VIEWSTATE" value="dDwtMjM1MjAzMDYyO3Q8O2w8aTwxPjs+O2w8dDw7bDxpPDE+Oz47bDx0PDtsPGk8MD47P jtsPHQ8Q0ZWMDIwOV8xMTExNTIwOEM4Ny5DSFc7Oz47Pj47Pj47Pj47Ph6UpF/DLSsWCO6OofR5H 9DR0yBi" /> <IMG SRC="/chartfx62/temp/CFT0209_11115405D1C.png" WIDTH="587px" HEIGHT="300px" > </form> </body> </HTML> Looking forward to hearing your thoughts on why the chart is slow. Sumesh "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:U4HwLyO7DHA.2336@webserver3.softwarefx.com... > Also, is the PSS Service running ? Can you please check this in your > services (Administrative tools). > > Also, do a View Source on the resulting HTML page and check where is the > image source pointing to ? is it pointing to a service ? can you please post > that HTML tag. > > -- > FP > Software FX > > Link to comment Share on other sites More sharing options...
Software FX Posted February 9, 2004 Report Share Posted February 9, 2004 Ok. The problem here is that ChartFX is not able to communicate with the PSS Service. The TAG: <IMG SRC="/chartfx62/temp/CFT0209_11115405D1C.png"/> Is pointing to a disk image instead of directly to the service. I think the delay (2 secs) is caused by the same problem basically Chart FX is "timing out". The reason fort this is most likely to be that the port configured in the PSS writer differs from that used by the PSS Service. The writer defaults to port 8082 and this can be configured in chartfx.internet.config which has to be located in your application's bin folder. The service takes its configuration from ChartFX.PSS.Service.exe.config. To fix the problem simply copy chartfx.internet.config from your ChartFX folder (bin) to your application's bin folder. You config file should look something like: <CfxIESettings> <Relative>/ChartFX62/Temp</Relative> <PSS.OutputWriter> <Channel>System.Runtime.Remoting.Channels.Tcp.TcpChannel,System.Runtime.Remo ting</Channel> <ServiceURL>tcp://localhost:8083/ChartService</ServiceURL> </PSS.OutputWriter> <DefaultWriter>SoftwareFX.ChartFX.PSS.PSSWriter,ChartFX.PSS.OutputWriter</De faultWriter> <DefaultWriterSettings> <ExpirationTime>0:0:0</ExpirationTime> <MemorySlidingExpiration>0:0:0</MemorySlidingExpiration> <UseAuthentication>true</UseAuthentication> </DefaultWriterSettings> </CfxIESettings> Notice the tcp://localhost:8083/ChartService part is the part that tell the writer which port to use to communicate with the service. At the end, all three config files (chartfx.internet.config, ChartFX.PSS.Service.exe.config and the Web.config in PSS\HttpHandler) should all point to the same port. -- FP Software FX Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.