Welcome, Guest
Username: Password: Remember me
CodeTyphon MS Windows (Win7, Win8.x, Win10 and Win11) OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

TCHART series values of serie x,y 2 hours 57 minutes ago #19523

  • Fernando Sandoval
  • Fernando Sandoval's Avatar Topic Author
  • Away
  • Junior Member
  • Junior Member
  • Posts: 64
  • Thank you received: 0
Hi was strange i save values and show tchart but you know allways tried to excell chart for verified or presentation , i create a procedure to export data form chart series values and my confuse was i don't see a ny value on axe y.... my questios is why?

procedure TFormCharts.BtnToExcellClick(Sender: TObject);
Var I,It,s:integer;
    SourceSeries:TLIneSeries;
    MyWorkbook: TsWorkbook;
    MyWorksheet: TsWorksheet;
begin
   MyWorkbook := TsWorkbook.Create;
   MyWorkbook.SetDefaultFont('Calibri', 9);
   MyWorkbook.Options := MyWorkbook.Options + [boCalcBeforeSaving];

   For s:=0 to  Chart1.SeriesCount-2 do begin
    SourceSeries:=TLineSeries(ChartListbox1.Series);
     if( SourceSeries.Count > 0) then begin
      MyWorksheet := MyWorkbook.AddWorksheet('Grafica '+inttostr(s+1));
      MyWorksheet.WriteText(0, 1, 'Axe X');
      MyWorksheet.WriteText(0, 2, 'Axe Y');

      for i := 0 to SourceSeries.Count - 1 do
         MyWorksheet.WriteNumber(i+1, 1, SourceSeries.GetXValue(i));
         MyWorksheet.WriteNumber(i+1, 2, SourceSeries.GetYValue(i));
      end;

   end;
   MyWorkbook.WriteToFile(GetCurrentDir + '\testfrafica.xls', sfExcel8, true);
   MyWorkbook.Free;

end;

here where savein for chart values

        PX:= strtoint(Copy(MDatas, PP+1, (PF-(PP+1)) ));
          PY:= strtoint(Copy(MDatas, PF+1,lp));
          if( (ConsForce <>0 ) and (MaxForce <>0) and( Factforce<> 0)) then begin
            PYF:=RoundTo( ConsForce *(PY/(MaxForce/FactForce)),-2);
          end else begin
              PYF:=PY;
          end;

          if( ChartCount =0 )then  begin
             FormCharts.LCSCLS1.Add(PX, PYF);
          end else if(ChartCount=1) then begin
             FormCharts.LCSCLS2.Add(PX, PYF);
          end else if(ChartCount=2) then begin
             FormCharts.LCSCLS3.Add(PX, PYF);
  
how i can have both values .....

Please Log in or Create an account to join the conversation.

  • Page:
  • 1