4-8 左目盛の文字調整

With ActiveChart.Axes(xlValue)
     .TickLabels.Font.Size = 8
         If .MaximumScale < 1001 Then
            .MinimumScale = Int(Int(yasune * 0.8) / 10) * 10
        Else
            .MinimumScale = Int(Int(yasune * 0.8) / 100) * 100
        End If
End With 
上記例実行で、左図の目盛を右図のように最低値と文字サイズを変更できます。


(1) パターンの設定各種


With Selection
.MajorTickMark = xlNone      (目盛りの種類)
.MinorTickMark = xlOutside     (補助目盛)
.TickLabelPosition = xlNextToAxis (軸のラベル位置)
End With

目盛りの種類 
.MajorTickMark = xlInside  内向き
.MajorTickMark = xlOutside 外向き
.MajorTickMark = xlCross  交差
.MajorTickMark = xlNone   なし

補助目盛りの種類(上記と同じ)

軸のラベル位置
.TickLabelPosition = xlNone (なし)
.TickLabelPosition = xlNextToAxis(軸の下/左)
.TickLabelPosition = xlLow(下端し/左端)
.TickLabelPosition = xlHigh(上端し/右端)



.LineStyle = xlAutomatic (自動)
.LineStyle = xlNone (なし)
.LineStyle = xlContinuous (指定)
軸→指定の場合
With Selection.Border
.ColorIndex = 3  (色)
.Weight = xlThick  (太さ)
.LineStyle = xlContinuous (スタイル)
End With


-------------------------------------------------------------------------------------------
(2) 目盛の各種設定

With ActiveChart.Axes(xlValue)
.MinimumScale = 3000     (最小値)
.MaximumScaleIsAuto = True  (最大値)
.MinorUnitIsAuto = True   (補助目盛り間隔)
.MajorUnitIsAuto = True   (目盛り間隔)
.Crosses = xlAutomatic    (軸と他の軸の交差を設定)
.ReversePlotOrder = False  (軸を反転する)Trueで表示上側
.ScaleType = xlLinear    (対数目盛を表示する)
.DisplayUnit = xlNone
End With


軸と他の軸の交差を設定の指定
.Crosses = xlAutomatic
.Crosses = xlMaximum
.Crosses = xlCustom  ’.CrossesAt で交差を指定

対数目盛を表示の指定
.ScaleType = xlLinear
.ScaleType = xlLogarithmic



-------------------------------------------------------------------------------------------
(3) フォントの各種設定


With Selection.TickLabels.Font
.Name = "MS Pゴシック"
.FontStyle = "標準"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With



-------------------------------------------------------------------------------------------
(4) 表示形式の各種設定


分類で「数値」を指定例
Selection.TickLabels.NumberFormatLocal = "#,##0.0"

分類で「標準」を指定例
Selection.TickLabels.NumberFormatLocal = "G/標準"





4-9 右目盛の文字調整

With ActiveChart.Axes(xlValue, xlSecondary)
     .TickLabels.Font.Size = 8
End With
[1] 4-8項と指定方法は同様であり、説明省略


4-10 下目盛の文字調整

With ActiveChart.Axes(xlCategory).TickLabels
        .Font.Size = 8
        .NumberFormatLocal = "yy/mm/dd"
        .Orientation = xlDownward
End With

With ActiveChart.Axes(xlCategory)
        .CrossesAt = 1
        .TickLabelSpacing = 2
        .TickMarkSpacing = 1
        .AxisBetweenCategories = True
        .ReversePlotOrder = True
End With
(1) 目盛の各種設定



.ReversePlotOrder = True で軸を反転させ日付の老番を右側にしています



(2) 配置の各種設定


With Selection.TickLabels
.Alignment = xlCenter
.Offset = 100
.ReadingOrder = xlContext
.Orientation = xlDownward→-90度を指定した場合(45度は45となる)
End With





4-11 プロットアリアの色

 ActiveChart.PlotArea.Interior.ColorIndex = 2






ColorIndex番号参考図






4-12 ボン例位置

 ActiveChart.Legend.Position = xlBottom    



Selection.Position = xlBottom   '下端
Selection.Position = xlCorner   ’右上隅
Selection.Position = xlTop     ’上端
Selection.Position = xlRight    ’右端
Selection.Position = xlLeft    ’左端






【戻る】