the smooth problem of Line

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
rubby
Newbie
Newbie
Posts: 38
Joined: Mon Aug 12, 2013 12:00 am

the smooth problem of Line

Post by rubby » 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

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());
    }
}
Attachments
3.JPG
3.JPG (17.1 KiB) Viewed 1961 times
no smooth.JPG
no smooth.JPG (13.59 KiB) Viewed 1987 times
smooth.JPG
smooth.JPG (22.66 KiB) Viewed 1987 times

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

Re: the smooth problem of Line

Post by Yeray » Tue Sep 10, 2013 2:48 pm

Hi,

You are right. When you have a Line series with several equal values, the SmoothingFunction (or the Smoothed property) doesn't calculate the values correctly, so I've added it to the wish list to be revised for further releases (TJ71016716).

In the meanwhile, I can only think on checking when this situation happens and disable the Smoothed property.
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

rubby
Newbie
Newbie
Posts: 38
Joined: Mon Aug 12, 2013 12:00 am

Re: the smooth problem of Line

Post by rubby » Wed Sep 11, 2013 1:11 am

Hello Yeray,
Thanks for the reply.
where can we can get information of future release? I mean which bugs will fixed.
And what is the probable time?

Thanks!

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

Re: the smooth problem of Line

Post by Yeray » Thu Sep 12, 2013 7:32 am

Hi,

I'm afraid there's no public roadmap. What you an do is to follow new release announcements through this forum, the RSS news feed or our Twitter and Facebook accounts. And you can check what's implemented on each new release looking at the public release notes.
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

Post Reply