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
Can we delete Financial Functions?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi vasu,
I'm not sure if that's what you are looking for exactly but you can remove any TeeChart series like this:
or
If this doesn't help don't hesitate to let us know.
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);
Code: Select all
tChart.getSeries().remove(0);
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: Can we delete Financial Functions?
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
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
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi vasu,
Yes, you can add mouse events like this:
And then implement tChartMouseListened:
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) {
}
});
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 |
Instructions - How to post in this forum |
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,
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,
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi cdn,
An option would be that you increased selected series pen size to mark it, for example:
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 |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi cdn,
In that case you can typecast your series like this:
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 |
Instructions - How to post in this forum |