[SOLVED]Please help,TaChart learning. lazarus / 55-TAChart ---------------------------------------------------------------------- Robert W.B. · 2012-03-28 16:36 I tried to learn how to do a simple line chart that's is important to me. Can any one give me a code for this chart. 48 bars in my chart. begin var myarray[1..48] of ???  begin for a:=1 to 48 do begin chart1 // show myarray values in  chart1!!!  end; end. Please help. Best regards Rob ---------------------------------------------------------------------- Ask · 2012-03-28 17:30 Look at components/tachart/demo for various demo projects. Start from the basic demo. ---------------------------------------------------------------------- Robert W.B. · 2012-03-28 18:20 Why can't this simple code work! I have a chart on a form and a button. procedure TForm1.Button1Click(Sender: TObject); var   i:integer; begin   for i:=1 to 10 do begin   Chart1.series.Index:=i; // errormessage= Listindex(0) out of bounds    end; end; end.      I must be completely stupid ! Can anyone correct the code for me? Best regards Rob ---------------------------------------------------------------------- Laksen · 2012-03-28 18:46 Place a TChart and a TUserDefinedChartSource component on the form. Double click the Chart. This will bring up the "Edit series" window. Click add, and then select Line series. Select the line series and change the Source property to the UserDefinedChartSource1 component. Click the UserDefinedChartSource1. Set the PointsNumber property to 48 Now doubleclick the UserDefinedChartSource1 component. This will give you the following: Code: [Select]procedure TForm1.UserDefinedChartSource1GetChartDataItem(ASource: TUserDefinedChartSource; AIndex: Integer; var AItem: TChartDataItem); begin end; Simply change that to: Code: [Select]procedure TForm1.UserDefinedChartSource1GetChartDataItem(ASource: TUserDefinedChartSource; AIndex: Integer; var AItem: TChartDataItem); begin    AItem.Y := MyArray[AIndex+1]; // AIndex starts from 0, and goes to 47 end; ---------------------------------------------------------------------- tomek · 2012-03-28 18:54 Put TChart on the form, then: Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var   i:integer;   Bser: TBarSeries; begin   Bser:=TBarSeries.Create(Chart1);   for i:=1 to 48 do     Bser.Add(i,IntToStr(i),clRed);   Chart1.AddSeries(Bser); end; ---------------------------------------------------------------------- Robert W.B. · 2012-03-28 19:21 The code looks nice but,shall i put something in uses? unit1.pas(37,19) Error: Identifier not found "TBarSeries" unit1.pas(37,19) Error: Error in type definition unit1.pas(39,19) Error: Identifier not found "TBarSeries" unit1.pas(41,10) Error: Illegal qualifier unit1.pas(42,24) Error: Incompatible type for arg no. 1: Got "", expected "TBasicChartSeries" tagraph.pas(740,18) Hint: Found declaration: TChart.AddSeries(TBasicChartSeries); unit1.pas(47) Fatal: There were 5 errors compiling module, stopping Best regards Rob ---------------------------------------------------------------------- Robert W.B. · 2012-03-28 19:51 UserDefinedChartsource1 on the form. Thank you everybody for saving my day. Best regards Rob ---------------------------------------------------------------------- tomek · 2012-03-28 19:54 Quote from: robbanux on March 28, 2012, 09:21:44 pmThe code looks nice but,shall i put something in uses? TASeries