Can we delete Financial Functions?

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
cdn
Newbie
Newbie
Posts: 29
Joined: Wed Sep 19, 2007 12:00 am

Can we delete Financial Functions?

Post by cdn » Wed Oct 10, 2007 5:54 am

Hi:

We are trying to be able to delete financial indicators (ex. POV, Momentum etc.) after they are drawn inside a chart window so we get enough real estate to draw another indicator. And, we are using FastLine to draw these indicators. Is it possible to select the indicators and delete them? We could able to select and delete a line. But, not able to provide similar functionality associated to FastLine. Any inputs/insights are appreciated. Thanks.

regards,
vasu

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Oct 10, 2007 9:49 am

Hi vasu,

I'm not sure if that's what you are looking for exactly but you can remove any TeeChart series like this:

Code: Select all

                tChart.getSeries().remove(fastLine1);
or

Code: Select all

                tChart.getSeries().remove(0);
If this doesn't help don't hesitate to let us know.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

cdn
Newbie
Newbie
Posts: 29
Joined: Wed Sep 19, 2007 12:00 am

Re: Can we delete Financial Functions?

Post by cdn » Wed Oct 10, 2007 12:22 pm

Thanks, Narcis for the response. BTW, that is what we are currently doing (this is not the ideal solution).

But, how can we select the particular the FastLine? Once we select the indicator, then we can give right mouse click (drop-down) for deleting the selected fastline. So, the flow is -

draw_indicator -> select_indicator -> delete_indicator (is need be) .

Is this feasible? Thanks.

regards,
vasu

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Oct 10, 2007 2:30 pm

Hi vasu,

Yes, you can add mouse events like this:

Code: Select all

                tChart.addMouseListener(new java.awt.event.MouseListener() {
                    public void mouseClicked(MouseEvent e) {
                        tChartMouseListened(e);
                    }
                    public void mouseEntered(MouseEvent e) {
                    }
                    public void mouseExited(MouseEvent e) {
                    }
                    public void mousePressed(MouseEvent e) {
                    }
                    public void mouseReleased(MouseEvent e) {
                    }
                });
And then implement tChartMouseListened:

Code: Select all

        private void tChartMouseListened(java.awt.event.MouseEvent e)
        {
            //Clicked button is right-button
            if (e.getButton() == e.BUTTON3)
            {
            for (int i=0; i<tChart.getSeriesCount(); i++)
                {
                    if (tChart.getSeries(i).clicked(e.getX(),e.getY()) != -1) {
                        tChart.getSeries().remove(i);
                        tChart.refreshControl();
                    }
                }
            }
        }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

cdn
Newbie
Newbie
Posts: 29
Joined: Wed Sep 19, 2007 12:00 am

Post by cdn » Tue Nov 13, 2007 6:47 am

Hi Narcis:

Thanks for the answer. This solution works great. Appreciate it much.

Now, what we need is - somehow able to show the user that particular series is selected as we have quite a few series close by. So, we are wondering whether we could show the user some sort of selected indication on a series when it is clicked to get deleted. Appreciate any information you can provide.

best regards,

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Nov 13, 2007 10:53 am

Hi cdn,

An option would be that you increased selected series pen size to mark it, for example:

Code: Select all

            series.getLinePen().setWidth(3);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

cdn
Newbie
Newbie
Posts: 29
Joined: Wed Sep 19, 2007 12:00 am

Post by cdn » Tue Nov 13, 2007 12:29 pm

Hi:

Thanks for the response. But how do we get access to "getLinePen()"? That seems to be only accessible for FastLine and Axes etc. not for Series. We poked around the API, but we could not locate the place where we could set the pen width.

best regards,

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Nov 13, 2007 12:55 pm

Hi cdn,

In that case you can typecast your series like this:

Code: Select all

((com.steema.teechart.styles.FastLine)tChart.getSeries(0)).getLinePen().setWidth(3);
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply