Microsoft Office Tutorials and References
In Depth Information
21.2.4 Z-Order and ChartObject Objects
co.Chart.Axes(xlValue).HasMajorGridlines = True
co.Chart.Axes(xlCategory).HasMajorGridlines = False
' Outside Tickmarks on category axis
co.Chart.Axes(xlCategory).MajorTickMark = xlTickMarkCross
' Move tick labels to below chart area
co.Chart.Axes(xlCategory).TickLabelPosition = _
xlTickLabelPositionNextToAxis
' Set chart area fill to solid white
co.Chart.ChartArea.Interior.Color = RGB(255, 255, 255)
' Set plot area fill to gray
co.Chart.PlotArea.Interior.ColorIndex = 15
' Format chart title
With co.Chart.ChartTitle
.Caption = "Great Chart"
.Font.Size = 14
.Font.Bold = True
.Border.Weight = xlThick
End With
End Sub
21.2.4 Z-Order and ChartObject Objects
Before looking at the main properties, methods, and children of the Chart object, we can get one
simple, but important, item out of the way.
Namely, it is possible for two or more embedded charts to overlap, which raises the question of
how to control which chart object appears on the top. Every ChartObject object has an order,
called its z-order , that indicates the object's relative position with respect to an imaginary z-axis
that comes directly out of the monitor at right angles, towards the user, as pictured in Figure 21-6 .
Figure 21-6. Illustrating z-order
The ChartObject object has a read-only ZOrder property that is used to return the z-order of the
ChartObject. It also has BringToFront and SendToBack methods for changing the z-order. These
properties can be used to shuffle the order of ChartObject objects.
 
Search JabSto ::




Custom Search