the smooth problem of Line
Posted: Tue Sep 10, 2013 8:11 am
Hello, i find a problem with Line graph.
the code is as follows:
the result is in the attachment "smooth.bmp"
when i remove the line " series.setSmoothed(true);" everything is fine.
the result is in the attachment "no smooth.bmp".
Moreover, if i change
" series.add(100000);
series.add(100000);
series.add(100000);
series.add(100000);
series.add(100000);"
to
"
series.add(100);
series.add(120);
series.add(350);
series.add(470);
series.add(500);
"
everything is fine too. Please see the attachment "3.bmp".
So I think there is some problem with the"setSmoothed".
Thanks
the code is as follows:
the result is in the attachment "smooth.bmp"
when i remove the line " series.setSmoothed(true);" everything is fine.
the result is in the attachment "no smooth.bmp".
Moreover, if i change
" series.add(100000);
series.add(100000);
series.add(100000);
series.add(100000);
series.add(100000);"
to
"
series.add(100);
series.add(120);
series.add(350);
series.add(470);
series.add(500);
"
everything is fine too. Please see the attachment "3.bmp".
So I think there is some problem with the"setSmoothed".
Thanks
Code: Select all
import com.steema.teechart.Dimension;
import com.steema.teechart.TChart;
import com.steema.teechart.editors.ChartEditor;
import com.steema.teechart.styles.Line;
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(); //随机数
Line series = new Line(tChart2.getChart());
series.add(100000);
series.add(100000);
series.add(100000);
series.add(100000);
series.add(100000);
series.setSmoothed(true);
series.getPointer().setVisible(true);
// tChart2.addSeries(new Bar()); // a bug
// 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);
// series2.setCircled(true);
// series2.getVertAxis().setAutomaticMinimum(false); //this is ok now.
// series2.getVertAxis().setMinimum(0);
// 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());
}
}