Jump to content
Software FX Community

Add a pane by code


User (Legacy)

Recommended Posts

Hi,

as mentioned in the previous mail I want to make a chart using the financial

extension in which a user can change the panes or add panes. Eg via a

listbox the user can switch the indicator Volume to TRIX or something else.

I am having trouble to do this. I will describe the problem below, but if

someone has an ASP.NET (vb/c#) sample which allows to add or change the type

of the pane, than that would be fine as well.

Here's the problem:

I found out how to add a pane (from another forum message). When my event

adds the pane the first time through the following code:

BeursChart.ClearData(SoftwareFX.ChartFX.ClearDataFlag.Data);

loaddata();

SoftwareFX.ChartFX.Financial.Server.Volume volume = new

SoftwareFX.ChartFX.Financial.Server.Volume();

volume.Visible = true;

this.financial1 = new SoftwareFX.ChartFX.Financial.Server.Financial();

this.financial1.Chart = this.BeursChart;

this.financial1.Gallery.Analytical.Studies.Add(volume);

This works fine the first time. Loaddata is code which will get data from

sql server and bind this to the chart.

However when I run the piece of code for the second time with another

indicator (eg TRIX) the applications produces the following error:

Object reference not set to an instance of an object.

This error will while closing the general OnInit(EventArgs e) event of the

webpage, so it doesn't even get to the point where the code above is. Also

when I run the page again immediately after the error the page shows one

time, but when running the code immediately the same error occurs.

It seems like the page has lost its state of an object, however I cannot

determine why or what. All state is kept default. The page itself is as

simple as can be as I am trying to test the ChartFX software.

So in general: HELP please! I think the chartfx product is great, but I

cannot figure out why it runs into this error.

One final remark on the product: up till now I have sent about 5 emails to

the sales department (at sales@softwarefx.com, sales@softwarefx.co.uk,

websales@softwarefx.com and via a direct mail to one of the sales people)

but no one reponds. Very strange that it seems like no one wants to sell

this fine product. Is softwareFX in financial trouble or something?

Yesterday the website was down.....and I do not see any response of support

in the past few days in these newsgroups. I do hope the company is still

active and these are just incidents if so can someone of sales please

respond to the emails.

Regards

Stefan

"Stefan" <stefan@ibrain.nl> wrote in message

news:N80Y$qMnFHA.3080@webserver3.softwarefx.com...

> Hi,

>

> is it possible to add a Pane code wise and fill it wis a financial

> indicator? I am using the 6.2 .NET demo version.

>

> I found

> this.financial3.Gallery.Analytical.Studies.AddRange()

> but it doesn't seem to add a pane as well.

> Regards

>

> Stefan

>

>

Link to comment
Share on other sites

Dear Stefan,

First of all you never want to create the Financial object more than once.

If you are doing that problems may arise. If the Financial object is saved

in the view state all you would need to do on the postback is to retrieve

the already created Financal object from the chart.extensions array.

Regarding the panes for Volume to TRIX this is a bit tricky.

It is alway better to let the Financial Extension handle the panes aspect.

So I would say your best bet is to add two studies originally and make one

Visible false

finext.Gallery.Analytical.Studies.Add(AnalyticalStudy.Volume);

Study study = finext.Gallery.Analytical.Studies.Add(AnalyticalStudy.TRIX);

study.Visible = false;

Then in your listbox changed event

do something like this

Study study =

finext.Gallery.Analytical.Studies.FindStudy(AnalyticalStudy.Volume);

study.Visible = false;

study = finext.Gallery.Analytical.Studies.FindStudy(AnalyticalStudy.TRIX);

study.Visible = true;

This will always work if you only have two studies. For more than two like

this: say you have Volume (visble) and TRix (not visble) and MACD( visible)

this is complicated and turning off Volume will just move MACD up as far as

panes are concerned. Turning Trix on will make Trix last. Let me know if

this is what you need.

Lastly, we have just moved offices and we had intermittent connections last

week.

We sincerely apologize for the delay but don't worry we are still here in

full force.

-cjs

"Stefan" <stefan@ibrain.nl> wrote in message

news:uHMnw6XnFHA.356@webserver3.softwarefx.com...

> Hi,

>

> as mentioned in the previous mail I want to make a chart using the

> financial extension in which a user can change the panes or add panes. Eg

> via a listbox the user can switch the indicator Volume to TRIX or

> something else. I am having trouble to do this. I will describe the

> problem below, but if someone has an ASP.NET (vb/c#) sample which allows

> to add or change the type of the pane, than that would be fine as well.

>

> Here's the problem:

> I found out how to add a pane (from another forum message). When my event

> adds the pane the first time through the following code:

> BeursChart.ClearData(SoftwareFX.ChartFX.ClearDataFlag.Data);

> loaddata();

> SoftwareFX.ChartFX.Financial.Server.Volume volume = new

> SoftwareFX.ChartFX.Financial.Server.Volume();

> volume.Visible = true;

> this.financial1 = new SoftwareFX.ChartFX.Financial.Server.Financial();

> this.financial1.Chart = this.BeursChart;

> this.financial1.Gallery.Analytical.Studies.Add(volume);

>

> This works fine the first time. Loaddata is code which will get data from

> sql server and bind this to the chart.

>

> However when I run the piece of code for the second time with another

> indicator (eg TRIX) the applications produces the following error:

> Object reference not set to an instance of an object.

>

> This error will while closing the general OnInit(EventArgs e) event of the

> webpage, so it doesn't even get to the point where the code above is. Also

> when I run the page again immediately after the error the page shows one

> time, but when running the code immediately the same error occurs.

>

> It seems like the page has lost its state of an object, however I cannot

> determine why or what. All state is kept default. The page itself is as

> simple as can be as I am trying to test the ChartFX software.

>

> So in general: HELP please! I think the chartfx product is great, but I

> cannot figure out why it runs into this error.

>

> One final remark on the product: up till now I have sent about 5 emails to

> the sales department (at sales@softwarefx.com, sales@softwarefx.co.uk,

> websales@softwarefx.com and via a direct mail to one of the sales people)

> but no one reponds. Very strange that it seems like no one wants to sell

> this fine product. Is softwareFX in financial trouble or something?

> Yesterday the website was down.....and I do not see any response of

> support in the past few days in these newsgroups. I do hope the company is

> still active and these are just incidents if so can someone of sales

> please respond to the emails.

>

> Regards

> Stefan

>

>

>

> "Stefan" <stefan@ibrain.nl> wrote in message

> news:N80Y$qMnFHA.3080@webserver3.softwarefx.com...

>> Hi,

>>

>> is it possible to add a Pane code wise and fill it wis a financial

>> indicator? I am using the 6.2 .NET demo version.

>>

>> I found

>> this.financial3.Gallery.Analytical.Studies.AddRange()

>> but it doesn't seem to add a pane as well.

>> Regards

>>

>> Stefan

>>

>>

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...