Page 1 of 1

the smooth problem of Line

Posted: Tue Sep 10, 2013 8:11 am
by 17466735
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());
    }
}

Re: the smooth problem of Line

Posted: Tue Sep 10, 2013 2:48 pm
by yeray
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.

Re: the smooth problem of Line

Posted: Wed Sep 11, 2013 1:11 am
by 17466735
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!

Re: the smooth problem of Line

Posted: Thu Sep 12, 2013 7:32 am
by yeray
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.