グラフ作成シリーズも架橋に入ってきました.今回は凡例をつける方法です.では,ちゃっちゃと行きましょう.
【事例】
Sub Graph_Legend_Make()
With ActiveSheet.ChartObjects.Add(50, 100, 300, 200).Chart
.SetSourceData Sheets("sheet1").Range("A3:D6")
.HasTitle = True
.ChartTitle.Text = "在庫調査"
End With
ActiveSheet.ChartObjects.ShapeRange.Name = "test"
With ActiveSheet.ChartObjects("test").Chart
.HasLegend = True
.Legend.Position = xlLegendPositionBottom
End With
End Sub
【解説】
結構簡単です.凡例の設置する場所は以下のように設定できます.
xlLegendPositionCorner 隅
xlLegendPositionRight 右
xlLegendPositionTop 上
xlLegendPositionBottom 下
xlLegendPositionLeft 左
楽勝楽勝.
0 件のコメント:
コメントを投稿