Hi,
I use FastLine graph and display Legend with checkbox on the graph. Series will be added dynamically.
When there are multiple series, The legend will show the a few series ( with Vertical scroll bar. When you click down arrow to scroll down, I got the following error. "List index out of bounds (10)". Even when I hit "OK" button to close the msg box, it appears again and again. Then the program couldn't run properly.
Environment: Delphi 2010
Current TeeChart version: V2012 pro
Previous TeeChart Version: version 8 pro
The program was implemented in TeeChart Pro version 8 and now it is upgraded to version 2012. It happens both version 8 and v2012.
Can anyone please help me out to solve this error?
Legend with Scrollbar - Error
-
- Newbie
- Posts: 16
- Joined: Wed May 18, 2005 4:00 am
- Location: Sydney, Australia
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Legend with Scrollbar - Error
Hi Matt,
I'm not able to reproduce the issue here using v2012.05.120327 and the code snippet below. Can you please modify it so that we can reproduce the problem here?
I'm not able to reproduce the issue here using v2012.05.120327 and the code snippet below. Can you please modify it so that we can reproduce the problem here?
Code: Select all
uses Series, TeeLegendScrollBar;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
for i:=0 to 50 do
Chart1.AddSeries(TFastLineSeries.Create(Self)).FillSampleValues;
Chart1.Tools.Add(TLegendScrollBar.Create(Self));
Chart1.View3D:=False;
end;
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 |
-
- Newbie
- Posts: 16
- Joined: Wed May 18, 2005 4:00 am
- Location: Sydney, Australia
- Contact:
Re: Legend with Scrollbar - Error
Hi Narcis,
Last days, I was trying to regenrate the error from your sample program but I couldn't able to do it.
But yesterday, I found out the cause of the problem. The cause is there are extra hidden series. For instance, I have 8 series added to the chart. But there is something worng in the program or the library, the total series count as 10. So, Scrollbar thinks there are 10 series. That's why when i hit down arrow key to go down and i get "List index out of bunds" error when i hit 9th series. Beause there is no 9th or 10th series in the graph.
Do you have any guides to fix the problem?
Can we have Up arrow or Down arrow Key event from Scrollbar and how?
Thanks in advance.
Last days, I was trying to regenrate the error from your sample program but I couldn't able to do it.
But yesterday, I found out the cause of the problem. The cause is there are extra hidden series. For instance, I have 8 series added to the chart. But there is something worng in the program or the library, the total series count as 10. So, Scrollbar thinks there are 10 series. That's why when i hit down arrow key to go down and i get "List index out of bunds" error when i hit 9th series. Beause there is no 9th or 10th series in the graph.
Do you have any guides to fix the problem?
Can we have Up arrow or Down arrow Key event from Scrollbar and how?
Thanks in advance.
Re: Legend with Scrollbar - Error
Hi Matt,
Thanks in advance.
It has to be something in your application that is creating this series. Could you please try to arrange a simple example project we can run as is to reproduce the problem here?Matt Venkat wrote:Last days, I was trying to regenrate the error from your sample program but I couldn't able to do it.
But yesterday, I found out the cause of the problem. The cause is there are extra hidden series. For instance, I have 8 series added to the chart. But there is something worng in the program or the library, the total series count as 10. So, Scrollbar thinks there are 10 series. That's why when i hit down arrow key to go down and i get "List index out of bunds" error when i hit 9th series. Beause there is no 9th or 10th series in the graph.
Do you have any guides to fix the problem?
Thanks in advance.
You can use the chart's OnKeyDown event to check if the TeeKey_Down/TeeKey_Up keys have been pressed. And you could combine it with the OnMouseMove event if you want to check the keys only when the mouse is in the Legend area. For example:Matt Venkat wrote:Can we have Up arrow or Down arrow Key event from Scrollbar and how?
Code: Select all
var MouseInLegend: Boolean;
procedure TForm1.FormCreate(Sender: TObject);
begin
MouseInLegend:=false;
end;
procedure TForm1.Chart1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if MouseInLegend then
case Key of
TeeKey_Down: Caption:='Down!';
TeeKey_Up: Caption:='Up!';
end;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
MouseInLegend:=(Chart1.Legend.Clicked(X,Y)>-1);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |