Page 1 of 1

Loading last view chart with Sorted ON

Posted: Wed Jan 21, 2009 9:21 pm
by 10551545
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.

Posted: Thu Jan 22, 2009 8:48 am
by narcis
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.

Posted: Thu Jan 22, 2009 9:56 pm
by 10551545
Works for me too now. Thanks, nile.