デルファイのプログラムからExcelのページを作成する必要があります。デルファイ6 - デルファイアプリケーションからExcelチャートを作成 - 同じページにデータとチャートを表示
私は「メンバーが見つかりませんでした」というエラーが表示されています。
ch1.Chart.SeriesCollection.Item[0].Values := Sheets.Item['Delphi Data'].Range['E5:E15'];
あなたが与えられた下
にそれを解決するために私を助けてくださいが使用するコードです。
procedure TForm1.ChartData;
var
ARange,Sheets,ch1 : Variant;
SSeries : Series;
num : integer;
ChartAxis : Axis;
lcid : Cardinal;
begin
ch1 := XLApp.ActiveWorkBook.Sheets[1].ChartObjects.Add (500,100,400,200); // creates a new chart in the specified
Sheets := XLApp.Sheets;
ch1.Chart.ChartWizard (
Sheets.Item['Delphi Data'].Range['D5:D15'], // 1 Source
xlBarStacked, // 2 The chart type.
8, // 3 Format
2, // 4 PlotBy
8, // 5 CategoryLabels
3, // 6 SeriesLabels
True, // 7 HasLegend - 'true' to include a legend.
'Sijos Report', // 8 Title - The Chart control title text.
'Y Legend', // 9 CategoryTitle - The category axis title text.
'X Legend', // 10 ValueTitle - The value axis title text
2 // 11 ExtraTitle - The series axis title for 3-D charts or the second value axis title for 2-D charts.
);
ch1.Chart.SetSourceData(Sheets.Item['Delphi Data'].Range['D5:D15'],xlColumns);
ch1.Chart.SeriesCollection.Item[0].Values := Sheets.Item['Delphi Data'].Range['E5:E15'];
ch1.Chart.SeriesCollection.Item[0].XValues := Sheets.Item['Delphi Data'].Range['F5:F15'];
End;
これは正しいです。今それは正常に動作します。ありがとうダビデ – SIJO
それは素晴らしいです! –