User (Legacy) Posted September 11, 2005 Report Share Posted September 11, 2005 How do I change the pricedisplay in the financial extension? In InitializeComponent the pricedisplay is initially set. However after a user clicks a button I want to change it from Close to HighLowClose. So something like: this.financial1.Gallery.Analytical.PriceDisplay = SoftwareFX.ChartFX.Financial.Server.PriceDisplay.HighLowClose; but this does not work. How do I remove the price series and add the highlowseries in the main chart being drawn? Link to comment Share on other sites More sharing options...
Software FX Posted September 12, 2005 Report Share Posted September 12, 2005 Edwin, I am confused when you say it "does not work" do you get a crash or just don't see the highlowclose? After you set the PriceDisplay property what is its' value ? Still close? Off the top of my head, I see three reasons why this line of code fails: 1) You have not passed enough data to the chart. Meaning you have only passed one or two series or you have passed three series and one is assigned to be volume series. This type of chart requires 3 series to be passed to the chart. In this case PriceDisplay would still be close AFTER you assign it. Furthermore, when you use the active client in internet explorer the Toolbar will not allow to switch to High Low Close. 2) You are assigning PriceDisplay BEFORE the InitializeComponent when IsPostBack is true and thus what you set it being overridded by what is in the InitComponent method. (This is unlikely but it depends on when the LoadViewState is called) The best place to do this kind of change is in the button_click event handler as that is AFTER the InitializeComponent happens. 3) You are assigning the PriceDisplay correctly in the button_click method and you have the correct data. However, you are assigning the value to the OLD financal1 object when you first generated the page. What happens is that the viewstate engine re-reads the chart and de-serializes it. However, this process is our own and thus on postback a new financial is created for the page but then we re-read in ours and create a new one. The pointer to financial1 on the page is now the wrong pointer. To fix this add this code to your event handler at the beginning of the method: financial1 = (Financial) Chart1.Extensions[0]; This code relinks up the financial1 on your page to the one that is really attached (and was read) by the chart. Lastly, the correct newsgroup for these kind of Extension issues is "chartfx.extensions" Please direct your queries to there if they are extension related. Hope this helps. -c "Edwin" <info@ibrain.nl> wrote in message news:Bf7xh$wtFHA.4084@webserver3.softwarefx.com... > How do I change the pricedisplay in the financial extension? In > InitializeComponent the pricedisplay is initially set. However after a > user clicks a button I want to change it from Close to HighLowClose. > So something like: > this.financial1.Gallery.Analytical.PriceDisplay = > SoftwareFX.ChartFX.Financial.Server.PriceDisplay.HighLowClose; > > but this does not work. How do I remove the price series and add the > highlowseries in the main chart being drawn? > Link to comment Share on other sites More sharing options...
User (Legacy) Posted September 12, 2005 Author Report Share Posted September 12, 2005 Thanks. It was the third option that did the tric, so relinking to the new financial1. "Software FX Support" <support@softwarefx.com> wrote in message news:yJTgzm6tFHA.2656@webserver3.softwarefx.com... > Edwin, > I am confused when you say it "does not work" do you get a crash or just > don't see the highlowclose? > After you set the PriceDisplay property what is its' value ? Still close? > > Off the top of my head, I see three reasons why this line of code fails: > 1) You have not passed enough data to the chart. Meaning you have only > passed one or two series or you have passed three series and one is > assigned to be volume series. This type of chart requires 3 series to be > passed to the chart. In this case PriceDisplay would still be close AFTER > you assign it. Furthermore, when you use the active client in internet > explorer the Toolbar will not allow to switch to High Low Close. > > 2) You are assigning PriceDisplay BEFORE the InitializeComponent when > IsPostBack is true and thus what you set it being overridded by what is in > the InitComponent method. (This is unlikely but it depends on when the > LoadViewState is called) The best place to do this kind of change is in > the button_click event handler as that is AFTER the InitializeComponent > happens. > > 3) You are assigning the PriceDisplay correctly in the button_click method > and you have the correct data. However, you are assigning the value to the > OLD financal1 object when you first generated the page. What happens is > that the viewstate engine re-reads the chart and de-serializes it. > However, this process is our own and thus on postback a new financial is > created for the page but then we re-read in ours and create a new one. The > pointer to financial1 on the page is now the wrong pointer. To fix this > add this code to your event handler at the beginning of the method: > financial1 = (Financial) Chart1.Extensions[0]; > This code relinks up the financial1 on your page to the one that is really > attached (and was read) by the chart. > > Lastly, the correct newsgroup for these kind of Extension issues is > "chartfx.extensions" Please direct your queries to there if they are > extension related. > Hope this helps. > > -c > > > "Edwin" <info@ibrain.nl> wrote in message > news:Bf7xh$wtFHA.4084@webserver3.softwarefx.com... >> How do I change the pricedisplay in the financial extension? In >> InitializeComponent the pricedisplay is initially set. However after a >> user clicks a button I want to change it from Close to HighLowClose. >> So something like: >> this.financial1.Gallery.Analytical.PriceDisplay = >> SoftwareFX.ChartFX.Financial.Server.PriceDisplay.HighLowClose; >> >> but this does not work. How do I remove the price series and add the >> highlowseries in the main chart being drawn? >> > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.