Page 1 of 1
special characters are displayed in Axis titles
Posted: Mon Aug 08, 2011 11:00 am
by 15356328
Hello,
i am using Tchart component in my project.Special characters([]) are displayed at end of Axis titles.This is happening only German windows XP version.
- extrachar.GIF (34.71 KiB) Viewed 13383 times
please let me know how to avoid this.
Advance thanks for your reply.
Thanks,
Vijaya Raghava Rao
Re: special characters are displayed in Axis titles
Posted: Mon Aug 08, 2011 12:29 pm
by yeray
Hello Vijaya,
vijay wrote:i am using Tchart component in my project.Special characters([]) are displayed at end of Axis titles
I've tried the following code in both Swing and SWT but I can't reproduce the problem here in a Spanish machine. Does it reproduce the problem for you?
Code: Select all
tChart1.getAspect().setView3D(false);
FastLine fast1 = new FastLine(tChart1.getChart());
fast1.fillSampleValues();
tChart1.getAxes().getLeft().getTitle().setText("Sonde 1 [mA]");
vijay wrote:This is happening only German windows XP version.
Do you mean you've tried the same in another machine and it doesn't happen?
I also see that the image looks like an scanned paper or something similar. Doe the problem only happen when you print the chart or also in your application?
Re: special characters are displayed in Axis titles
Posted: Tue Aug 09, 2011 8:52 am
by 15356328
Hello Yaray,
Thank you for your reply.
special characters are appeared in German window XP version ( according to my investigation).In other Os It's working fine.
this problem is occurring both in printing the chart and also in the application.
Advance thanks for you reply.
Thanks,
Vijay
Re: special characters are displayed in Axis titles
Posted: Tue Aug 09, 2011 9:34 am
by yeray
Hi Vijay,
And does the simple code in the last message reproduce the problem for you? In other words, is the string "Sonde 1 [mA]" correct or is it missing any other character like end of line (\n) or anything else?
Could you also please precise if you are using Swing or SWT?
Re: special characters are displayed in Axis titles
Posted: Tue Aug 09, 2011 11:37 am
by 15356328
Hello Yeray,
I am using SWT.
Left Axis text "Sonde 1 [mA]\n ". I added \n to avoid overlapping of title with axis labels ( which was suggested by you).
Bottom Axis text "Zeit [s]".
In the both cases ( both axises) extra special character is appeared in German OS systems.In others It is ok.
Thanks for you reply.
Thanks,
Vijay
Re: special characters are displayed in Axis titles
Posted: Wed Aug 10, 2011 2:39 pm
by yeray
Hello Vijaya,
I've installed a fresh German WinXP SP3 32bit + the latest Eclipse Classic + the latest Java SDK + TeeChart Java v2.0.2.271 in a virtual machine.
I've tried both the application you attached
here and a simpler version of it with the following code and I can't see the strange characters.
Code: Select all
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.steema.teechart.TChart;
import com.steema.teechart.styles.FastLine;
public class Test {
static TChart tChart1;
public static void main(String [] args){
final Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setSize(600,400);
createChart(shell);
initializechart();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
private static void createChart(Shell tmpShell) {
tChart1 = new TChart(tmpShell, 0);
}
private static void initializechart() {
tChart1.getAspect().setView3D(false);
FastLine fast1 = new FastLine(tChart1.getChart());
java.util.Random rand = new java.util.Random();
for (int i=0; i<10; i++)
{
fast1.add(rand.nextInt((int) 5d));
}
tChart1.getAxes().getLeft().getTitle().setText("Sonde 1 [mA]\n ");
tChart1.getAxes().getBottom().getTitle().setText("Zeit [s]");
}
}
- test.png (19.17 KiB) Viewed 13307 times
You could try updating your eclipse and java.