Page 1 of 1

Using Editor in SWT

Posted: Wed Jan 28, 2009 6:55 pm
by 15351453
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

Posted: Thu Jan 29, 2009 8:43 am
by narcis
Hi Roger,

I'm afraid the SWT version doesn't include support for the editor at the present moment.

SWT Editor

Posted: Thu Jan 29, 2009 11:33 am
by 9523571
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

Posted: Thu Jan 29, 2009 3:03 pm
by yeray
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.

Posted: Thu Jan 29, 2009 6:30 pm
by 9523571
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

Posted: Tue Feb 03, 2009 11:52 am
by Marc
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