problem with radar
problem with radar
Hello,
I create a radar in TChart and put it on a JPanel,
When i change the size of panel,
the radar will change the size of itself. However,in a wrong way.
When I compare the radar with the radar generated by excel,
this confirm my judge.
Could you please tell me how to address this problem?
Thanks.
I create a radar in TChart and put it on a JPanel,
When i change the size of panel,
the radar will change the size of itself. However,in a wrong way.
When I compare the radar with the radar generated by excel,
this confirm my judge.
Could you please tell me how to address this problem?
Thanks.
Re: problem with radar
Hi,
Could you please post some screenshots of the problem and a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Could you please post some screenshots of the problem and a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: problem with radar
My code is as follows.
In the attachment, you can find two png files.
In the first png (radar1.png), you will see the radar graph is wrong.
In the second png(radar2.png), you will find that the value "33" is not showed correctly either.
Thus, when user changes the size of the dialog, the radar graph changes in a wrong mode.
In the attachment, you can find two png files.
In the first png (radar1.png), you will see the radar graph is wrong.
In the second png(radar2.png), you will find that the value "33" is not showed correctly either.
Thus, when user changes the size of the dialog, the radar graph changes in a wrong mode.
Code: Select all
import com.steema.teechart.Dimension;
import com.steema.teechart.Rectangle;
import com.steema.teechart.TChart;
import com.steema.teechart.editors.ChartEditor;
import com.steema.teechart.styles.Radar;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDialog;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
/**
*
* @author
*/
public class TestTeeChartJunit extends JDialog {
public TestTeeChartJunit() {
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setSize(new Dimension(581, 380));
setTitle("TeeChart for Java - Swing example application");
tChart2 = new TChart();
tChart2.setGraphics3D(null);
// tChart2.addSeries(new Line());
// tChart2.getSeries(0).fillSampleValues(); //随机数
// tChart2.addSeries(new Bar());
// tChart2.getSeries(0).add(10);
// tChart2.addSeries(new Bar());
// tChart2.getSeries(1).add(13);
// tChart2.addSeries(new Bar());
// tChart2.getSeries(2).add(49);
// tChart2.addSeries(new Bar());
// tChart2.getSeries(3).add(55);
Radar series2 = new com.steema.teechart.styles.Radar(tChart2.getChart());
series2.add(50); series2.add(33); series2.add(56); series2.add(88);series2.add(108);
tChart2.setBounds(new Rectangle(0, 0, 500, 500));
//设置图标的属性
tChart2.getAspect().setView3D(false); // no 3D
// tChart2.getLegend().setText("jw legend");
this.add(tChart2);
tChart2.setComponentPopupMenu(popup);
JMenuItem item = new JMenuItem("Property");
item.addActionListener(new RightListener(tChart2));
popup.add(item);
this.setVisible(true);
}
public static void main(String[] args) {
TestTeeChartJunit myChart = new TestTeeChartJunit();
}
TChart tChart2;
JPopupMenu popup = new JPopupMenu();
}
class RightListener implements ActionListener {
TChart tChart2 = null;
public RightListener(TChart chart) {
this.tChart2 = chart;
}
public void actionPerformed(ActionEvent e) {
ChartEditor.editChart(tChart2.getChart());
}
}
- Attachments
-
- radar2.png (62.15 KiB) Viewed 27627 times
-
- radar1.png (54.18 KiB) Viewed 27616 times
Re: problem with radar
Hi,
Gives me this:
That looks as your radar1.png image. However, I'm not sure to find any alternative in your code to generate the radar2.png.
Also, in radar2.png I think the value "33" is drawn correctly. Note it's the lower value in the series, so the axis minimum starts on it by default, so it's drawn on the center.
Then, adding this:
I think will give you the expected result for radar1.png.
And adding this:
I think will draw the "33" where you'd expect.
This code:rubby wrote:In the first png (radar1.png), you will see the radar graph is wrong.
In the second png(radar2.png), you will find that the value "33" is not showed correctly either.
Code: Select all
Radar series1 = new Radar(tChart1.getChart());
series1.add(50);
series1.add(33);
series1.add(56);
series1.add(88);
series1.add(108);
tChart1.getAspect().setView3D(false);
Also, in radar2.png I think the value "33" is drawn correctly. Note it's the lower value in the series, so the axis minimum starts on it by default, so it's drawn on the center.
Then, adding this:
Code: Select all
series1.setCircled(true);
And adding this:
Code: Select all
series1.getVertAxis().setAutomaticMinimum(false);
series1.getVertAxis().setMinimum(0);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: problem with radar
Thanks Yeray , my problem is addressed.
Re: problem with radar
Hello,
I still find that radar graph of teechart is different from the excel radar.
one is anticlockwise, the other is clockwise .
I do not find any method to set the radar graph of teechat to clockwise.
Does it exist?
thank you.
I still find that radar graph of teechart is different from the excel radar.
one is anticlockwise, the other is clockwise .
I do not find any method to set the radar graph of teechat to clockwise.
Does it exist?
thank you.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: problem with radar
Hi rubby,
There's setClockWiseLabels for that. It should reverse the painting order of series and labels but it's not working so I have added it [ID450] to the bug list to be fixed.
There's setClockWiseLabels for that. It should reverse the painting order of series and labels but it's not working so I have added it [ID450] to the bug list to be fixed.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: problem with radar
Hello,
I encounter a strange problem with radar graph.
the axis is not in the right position.【radar axis wrong position.png】
what i need it the one in the attachment 【radar correct position.png】.
How can i set the current position of this axis by myself.
is it radar.getVertAxis()... or something else?
Thanks.
I encounter a strange problem with radar graph.
the axis is not in the right position.【radar axis wrong position.png】
what i need it the one in the attachment 【radar correct position.png】.
How can i set the current position of this axis by myself.
is it radar.getVertAxis()... or something else?
Thanks.
- Attachments
-
- radar correct position.png (87.77 KiB) Viewed 27333 times
-
- radar axis wrong position.png (90.06 KiB) Viewed 27324 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: problem with radar
Hi rubby,
I can not reproduce this. Are those screen-shots made with different TeeChart versions? Otherwise, which settings differ from one chart to the other?
Thanks in advance.
I can not reproduce this. Are those screen-shots made with different TeeChart versions? Otherwise, which settings differ from one chart to the other?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: problem with radar
Hello,
I am sorry for late reply because of something.
This always happens when i saved the radar graph as xml files and import it again (in my software which integrates Teechart).
However, i can not reproduce this problem by a simple example.
this screen-shots use the same and latest version.
Thanks.
I am sorry for late reply because of something.
This always happens when i saved the radar graph as xml files and import it again (in my software which integrates Teechart).
However, i can not reproduce this problem by a simple example.
this screen-shots use the same and latest version.
Thanks.
Re: problem with radar
Hi,
I've made a test and the following seems to work fine for me here.
I've made a test and the following seems to work fine for me here.
Code: Select all
String tmpName = "E:\\tmp\\JavaXML.xml";
//Initialize
private void initChart() {
commander1.setChart(tChart1.getChart());
Random rnd = new Random();
for (int i = 0; i < 2; i++) {
Radar tmpRadar = new Radar(tChart1.getChart());
for (int j = 0; j < 5; j++) {
tmpRadar.add(50+rnd.nextDouble()*25);
}
tmpRadar.setCircled(true);
tmpRadar.getVertAxis().setMinMax(0, 100);
tmpRadar.getBrush().setVisible(false);
}
}
//Export to XML Button
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
try {
tChart1.getExport().getData().getXML().save(tmpName);
} catch (IOException e) {
System.out.println(e);
}
}
//Clean Chart Button
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
tChart1.removeAllSeries();
}
//Import from XML Button
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
try {
tChart1.getImport().getXML().open(tmpName);
} catch (IOException ex) {
System.out.println(ex);
} catch (ClassNotFoundException ex) {
System.out.println(ex);
}
for (int i = 0; i < tChart1.getSeriesCount(); i++) {
if (tChart1.getSeries(i) instanceof Radar) {
Radar tmpRadar = (Radar) tChart1.getSeries(i);
tmpRadar.setCircled(true);
tmpRadar.getVertAxis().setAutomaticMinimum(false);
tmpRadar.getVertAxis().setMinimum(0);
tmpRadar.getBrush().setVisible(false);
}
}
tChart1.getAspect().setOrthogonal(true);
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: problem with radar
Hello,
thanks for the reply.
I also code some simple examples, but the problem can not happen either.
I would let you know if i get the idea of how to reproduce this problem.
Thanks.
thanks for the reply.
I also code some simple examples, but the problem can not happen either.
I would let you know if i get the idea of how to reproduce this problem.
Thanks.