日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Delphi 操作EXCEL折线图

發(fā)布時間:2023/12/29 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Delphi 操作EXCEL折线图 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
//1.增加一個二維圖chartobjects.add(Left, Top, 寬,高)
chart1 := xlssheet1.chartObjects.Add(l_left,l_top,l_Width,l_Height);


//2.選擇二維圖的形態(tài)
chart1.Activate;
chart1.chart.charttype := xlXYScatterLines;


//線條說明位置
chart1.chart.Legend.Position := xlLegendPositionTop;
//chart1.chart.Legend.Top := 5;




//3.給二維圖賦值
series := chart1.chart.SeriesCollection;


//4.給二維圖加上標(biāo)題
chart1.chart.HasTitle := true;
chart1.chart.ChartTitle.Characters.Text := 'A';
chart1.chart.ChartTitle.Font.size := 12;


//(xlValue, xlPrimary) 左標(biāo)


chart1.Chart.Axes(xlValue, xlPrimary).HasTitle := True;
chart1.Chart.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text := 'A';


//( xlCategory , xlPrimary )下標(biāo)


chart1.Chart.Axes(xlCategory, xlPrimary).HasTitle := True;
chart1.Chart.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text := 'B';
chart1.Chart.Axes(xlCategory, xlPrimary).HasMinorGridlines? := True;
chart1.Chart.Axes(xlCategory, xlPrimary).HasMajorGridlines? := True;
chart1.Chart.Axes(xlCategory, xlPrimary).MaximumScaleIsAuto := True;
chart1.Chart.Axes(xlCategory, xlPrimary).MinimumScaleIsAuto := True;
chart1.Chart.Axes(xlCategory, xlPrimary).MinorUnitIsAuto? ? := True;
chart1.chart.Axes(xlCategory, xlPrimary).ScaleType := xlScaleLinear;
//xlTickLabelOrientationAutomatic -4105 由 Microsoft Word 設(shè)定文字方向。
//xlTickLabelOrientationDownward -4170 文字向下。
//xlTickLabelOrientationHorizontal -4128 字元水平排列。
//xlTickLabelOrientationUpward -4171 文字向上。
//xlTickLabelOrientationVertical -4166 字元垂直排列。
chart1.chart.Axes(xlCategory, xlPrimary).ticklabels.Orientation := xlTickLabelOrientationUpward;


//第一條線
ExcelCount := xlssheet3.Usedrange.Rows.Count;
series.NewSeries;
se := chart1.chart.seriescollection(1);
se.Name :='線條說明';
AX := 'A' +InttoStr(ExcelCount);
se.XValues := '=sheet3!A2:'+ AX;
BX := 'B' +InttoStr(ExcelCount);
se.Values := '=sheet3!B2:'+BX;


//第二條線
series.NewSeries;
se := chart1.chart.seriescollection(2);
se.Name :='線條說明';
AX := 'A' +InttoStr(ExcelCount);
se.XValues :=? '=sheet3!A2:'+AX;
CX := 'C' +InttoStr(ExcelCount);
se.Values := '=sheet3!C2:'+CX;


//設(shè)置數(shù)據(jù)集為次要坐標(biāo)軸
se.AxisGroup := xlSecondary;
//設(shè)置次有坐標(biāo)軸說明( xlValue , xlSecondary )右標(biāo)
chart1.Chart.Axes(xlValue, xlSecondary).HasTitle := True;
chart1.Chart.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text := 'C';

總結(jié)

以上是生活随笔為你收集整理的Delphi 操作EXCEL折线图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。