1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| procedure graph();
var
XL: variant;
aFileName, aSheetName : AnsiString;
vXLWorkbooks,vXLWorkbook, vUnused, vSeparator : variant;
resultat, MaFeuille, CurrentSheet, DataSheet: Variant;
MonGraph: _chart;
XAxe, YAxe, ChartObject: variant;
begin
XL := CreateOLEObject('Excel.application');
XL.Visible:= True;
aFileName := 'C:\Users\pauld\Desktop\logfile_br1_2019_04_26';
vUnused := unassigned;
vSeparator := 4;
vXLWorkbooks := XL.Workbooks;
vXLWorkbook := vXLWorkbooks.Open(aFileName, vUnused, vUnused, vSeparator);
resultat:=vXLWorkbook.Worksheets[1];
resultat.chartobjects.add[10,10,100,100];
resultat:=resultat.chartobjects[1].chart;
XAxe:= vXLWorkbook.Worksheets[1].Range['C2','C8']; //c'est a partir de la que ca bloque... comment définir les axes? et comment définir les plage de valeur?
YAxe:= vXLWorkbook.Worksheets[1].Range['E2','E8'];
resultat.ChartType:=xlXYScatter;
resultat.SetSourceData(YAxe, xlColumns);
resultat.SeriesCollection.Add();
resultat.SeriesCollection(1).XValues:=XAxe;
resultat.SeriesCollection(1).Values:=YAxe; |
Partager