Using Editor in SWT

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
RogerNye
Newbie
Newbie
Posts: 11
Joined: Mon Jan 12, 2009 12:00 am

Using Editor in SWT

Post by RogerNye » Wed Jan 28, 2009 6:55 pm

Hi,
I am trying to make the Chart editor appear when the user double-clicks the chart. This is using the SWT implementation for TChart for Java 2.

I tried calling the TChart method:

Code: Select all

showEditor();
from inside a mouse listener.
The source code for showEditor seems to have the line:

Code: Select all

ChartEditor.editChart(...
commented out, so I guess this isn't it.

Anyone know how to display the editor?

Many thanks
Roger

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 29, 2009 8:43 am

Hi Roger,

I'm afraid the SWT version doesn't include support for the editor at the present moment.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Roger Nye
Newbie
Newbie
Posts: 10
Joined: Tue Aug 17, 2004 4:00 am

SWT Editor

Post by Roger Nye » Thu Jan 29, 2009 11:33 am

Hi Narcís,
Thanks for the quick response.

I am currently migrating from the ActiveX version to the Java version.
At some point I will need the editor
Do you know if/when it is likely to be supported in SWT?

I need to decide whether I should go back to the ActiveX version.

My immediate problem is that the data I am adding to a Candle doesn't appear. I hoped to use the editor to understand why.

The data uses dates for the x-axis.
The dates show up correctly, but no values or y-axis.

My method is:

Code: Select all

_chart.getAxes().getLeft().setAutomatic(true);
Candle series = new Candle(_chart.getChart());
series.beginUpdate();
try
{
   for (int j = 0; j < m; j++)
   {
      DateTime dt = new DateTime(dates[j].YEAR, dates[j].MONTH - 1, dates[j].DAY);
      double open = prices[0][j];
      double low = prices[1][j];
      double high = prices[2][j];
      double close = prices[3][j];
      series.add(dt, open, high, low, close);
   }

   series.checkOrder();
   _chart.addSeries(series);
}
finally
{
   series.endUpdate();
}
Any idea what I am missing?

Many thanks
Roger

Yeray
Site Admin
Site Admin
Posts: 9570
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Thu Jan 29, 2009 3:03 pm

Hi Roger,

We made a simple example as we don't have the arrays you are using to fill in the series, but you shouldn't find problems with this.

So, please, could you check if this example works fine for you? And feel free to modify it to let us reproduce the problem.

Code: Select all

candleSeries = new Candle(chart1.getChart());

for (int j = 0; j < 5; j++)
{
   int i = j+1;
   DateTime dt = new DateTime(1,j+1,2009);
   double low = i;
   double open = i*3;
   double close = i*2;
   double high = i*4;
   candleSeries.add(dt, open, high, low, close);
}
Regarding SWT support, I'm afraid I can't tell you a date at this moment but we'll be back to you next week.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Roger Nye
Newbie
Newbie
Posts: 10
Joined: Tue Aug 17, 2004 4:00 am

Post by Roger Nye » Thu Jan 29, 2009 6:30 pm

Hi,
Thanks, that was very helpful for narrowing down the problem.

One of my values was a NaN and the whole series disappeared.

Best regards
Roger

Marc
Site Admin
Site Admin
Posts: 1254
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Feb 03, 2009 11:52 am

Hello Roger,

There are no short term plans to add Editor dialogues for the SWT version (except Print Preview that is already included). The Swing version will continue to include Editor support.

Regards,
Marc Meumann
Steema Support

Post Reply