Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

IChart as JComponent?
 Post subject: IChart as JComponent? Post rating: 0   Post Posted: Tue 10 Nov, 2009, 14:37 

User rating: 0
Joined: Sat 07 Nov, 2009, 00:25
Posts: 11
Hi,

I want to be able to create an IChart and wrap it in some kind of JComponent like JPanel. Similar to what the IUserInterface does. The solution I'm looking for may not neccesarily require visual mode.

Anyone?


Thanks.
Mr A. Anderson


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Wed 11 Nov, 2009, 13:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,
could you please describe your problem in detail?
What do you mean saying
Quote:
Similar to what the IUserInterface does


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Thu 12 Nov, 2009, 11:59 

User rating: 0
Joined: Sat 07 Nov, 2009, 00:25
Posts: 11
Hey, if you take a look at the API for IUserInterface:

https://www.dukascopy.com/swiss/docs/api/

you'll notice that there are two methods that return a JPanel. Namely getBottomTab(String key), and getMainTab(String key). IF for example, a chart is open in the main tab, it would have been wrapped into a JPanel to be displayed in the UserInterface. I want to be able to programatically wrap an IChart into a JPanel myself without going through IUserIntergace.

I hope this is clearer.


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Fri 13 Nov, 2009, 09:26 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Do you want IUserInterface to return chart as a JPanel?
It would be easier to understand if you would tell us what do you want to do with it? Do you want to show it in some separate window or ?
Caleb wrote:
The solution I'm looking for may not neccesarily require visual mode.

What is the point in chart if it's not in visual mode?


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Fri 13 Nov, 2009, 22:18 

User rating: 0
Joined: Sat 07 Nov, 2009, 00:25
Posts: 11
Support wrote:
Do you want to show it in some separate window... ?

...Yes. I am working on a custom GUI for my Strategy. In a nutshell, I want to be able to invoke an IChart, edit it, and display it on a separate JPanel (or JComponent) like this:

IChart tempChart = IContext.getChart(Instrument.GBPUSD);
tempChart.draw(...);
.
.
.
JPanel tempPanel = ...;
tempPanel.add(tempChart);


I dont want to have to use an IUserInterface to get the chart wrapped in a JComponent. The point I was trying to make with IUserInterface is that some similar coding must already exist for those mothods (getBottomTab, and getMainTab) to return a JPanel. Otherwise, what other alternatives are there for displaying an IChart within custom code?


I appreciate your patience.
Mr Anderson.


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Mon 16 Nov, 2009, 10:07 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Unfortunately it's not possible at this moment, but we will consider adding it in the future


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Fri 20 Nov, 2009, 19:56 

User rating: 0
Joined: Sat 07 Nov, 2009, 00:25
Posts: 11
Ok, thanks.

So how is an IChart displayed? I look through this tutorial:

https://www.dukascopy.com/swiss/english/ ... IChart.htm

It talks about how an IChart is invoked programmatically and how it is manipulated but does not seem to mention how or where the chart window is actually displayed.


Mr Anderson.


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Tue 24 Nov, 2009, 11:10 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
For now, strategies cannot control where charts are displayed. It's up to user to decide should the chart be displayed in JForex window maximized or shown in internal frame or maybe undocked.


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Mon 08 Nov, 2010, 21:23 

User rating: -
Is there any way to display the chart outside JForex platform - in separate window?


 
 Post subject: Re: IChart as JComponent? Post rating: 0   Post Posted: Tue 09 Nov, 2010, 14:15 

User rating: 0
Joined: Tue 27 Jul, 2010, 20:57
Posts: 49
@kastor Yes you can detach any charts, messages, news etc.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com