Loading last view chart with Sorted ON

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
nile
Newbie
Newbie
Posts: 25
Joined: Tue Jan 20, 2009 12:00 am
Location: Auckland
Contact:

Loading last view chart with Sorted ON

Post by nile » Wed Jan 21, 2009 9:21 pm

Hi,

I've tried this code for loading the last viewed chart from a registry setting,

if(Chart->Series[var])
Chart->Series[var]->Active = true;

or
for(int i = 0; i<ChartListBox->Count; i++){
if(ChartListBox->Series->Name == var){
Chart->Series->Active = true;
break;
}
}

Both work fine when the ChartListBox Sorted is Off. However, when On, I cannot seem to find away of identifying the last used series?

Thanks, nsm.
To be or not to be. This is not the question. Rather it is a choice.

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

Post by Narcís » Thu Jan 22, 2009 8:48 am

Hi nile,

This works fine for me here using code below and using any Sorted setting.

Code: Select all

procedure TForm1.Chart1ClickSeries(Sender: TCustomChart;
  Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var i: Integer;
begin
  for i:=0 to ChartListBox1.Count-1 do
  begin
    ChartListBox1.Series[i].Active:=(ChartListBox1.Series[i].Name=Series.Name);
  end;
end;
Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments or at our upload page.

Thanks in advance.
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

nile
Newbie
Newbie
Posts: 25
Joined: Tue Jan 20, 2009 12:00 am
Location: Auckland
Contact:

Post by nile » Thu Jan 22, 2009 9:56 pm

Works for me too now. Thanks, nile.
To be or not to be. This is not the question. Rather it is a choice.

Post Reply