21.08.2013 Views

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Structure of Charts<br />

com.sun.star.chart.ChartAxisZSupplier<br />

com.sun.star.chart.ChartTwoAxisXSupplier<br />

com.sun.star.chart.ChartTwoAxisYSupplier<br />

Different services are supported depending on the chart type (see Chart Types).<br />

Wall and Floor<br />

The chart wall is the background of the coordinate system where the data is plotted. Two chart walls usually exist<br />

for 3D charts: one behind the plotted data and one as the left-hand or right-hand demarcation. This depends on<br />

the rotation of the chart. 3D charts usually also have a floor.<br />

The Diagram object provides the properties Wall and Floor:<br />

Wall (Object)<br />

background wall of the coordinate system (supports com.sun.star.chart.ChartArea service)<br />

Floor (Object)<br />

floor panel of coordinate system (only for 3D charts, supports com.sun.star.chart.ChartArea service)<br />

The specified objects support the com.sun.star.chart.ChartArea service, which provides the usual fill and<br />

line properties (com.sun.star.drawing.FillProperties and com.sun.star.drawing.LineProperties services, refer to<br />

Drawings and Presentations).<br />

The following example shows how graphics (named Sky) already contained in <strong>OpenOffice</strong>.<strong>org</strong> can be used as a<br />

background for a chart. The wall is set to be blue.<br />

Dim Doc As Object<br />

Dim Charts As Object<br />

Dim Chart as Object<br />

Dim Rect As New com.sun.star.awt.Rectangle<br />

Dim RangeAddress(0) As New com.sun.star.table.CellRangeAddress<br />

Rect.X = 8000<br />

Rect.Y = 1000<br />

Rect.Width = 10000<br />

Rect.Height = 7000<br />

RangeAddress(0).Sheet = 0<br />

RangeAddress(0).StartColumn = 0<br />

RangeAddress(0).StartRow = 0<br />

RangeAddress(0).EndColumn = 2<br />

RangeAddress(0).EndRow = 12<br />

Doc = ThisComponent<br />

Charts = Doc.Sheets(0).Charts<br />

Charts.addNewByName("MyChart", Rect, RangeAddress(), True, True)<br />

Chart = Charts.getByName("MyChart").EmbeddedObject<br />

Chart.Area.FillStyle = com.sun.star.drawing.FillStyle.BITMAP<br />

Chart.Area.FillBitmapName = "Sky"<br />

Chart.Area.FillBitmapMode = com.sun.star.drawing.BitmapMode.REPEAT<br />

Chart.Diagram.Wall.FillStyle = com.sun.star.drawing.FillStyle.SOLID<br />

Chart.Diagram.Wall.FillColor = RGB(00,132,209)<br />

Axes<br />

<strong>OpenOffice</strong>.<strong>org</strong> recognizes five different axes that can be used in a chart. In the simplest scenario, these are the X<br />

and Y-axes. When working with 3D charts, a Z-axis is also sometimes provided. For charts in which the values of<br />

the various rows of data deviate significantly from one another, <strong>OpenOffice</strong>.<strong>org</strong> provides a second X and Y-axis<br />

for second scaling operations.<br />

The Diagram object provides the following properties to access the axes:<br />

134 <strong>OpenOffice</strong>.<strong>org</strong> 3.2 <strong>BASIC</strong> <strong>Guide</strong> · March 2010

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!