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 />

The following example creates a 3D area chart.<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 />

Doc = ThisComponent<br />

Charts = Doc.Sheets(0).Charts<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 />

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

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

Chart.Diagram = Chart.createInstance("com.sun.star.chart.AreaDiagram")<br />

Chart.Diagram.Dim3D = true<br />

Chart.Diagram.Deep = true<br />

Chart.Diagram.RightAngledAxes = true 'needs <strong>OpenOffice</strong>.<strong>org</strong> 2.3 or newer<br />

Chart.Diagram.D3DScenePerspective = com.sun.star.drawing.ProjectionMode.PERSPECTIVE<br />

Chart.Diagram.Perspective = 100 'needs <strong>OpenOffice</strong>.<strong>org</strong> 2.4.1 or newer<br />

Chart.Diagram.RotationHorizontal = 60 'needs <strong>OpenOffice</strong>.<strong>org</strong> 2.4.1 or newer<br />

Chart.Diagram.RotationVertical = 30 'needs <strong>OpenOffice</strong>.<strong>org</strong> 2.4.1 or newer<br />

Stacked Charts<br />

Stacked charts are charts that are arranged with several individual values on top of one another to produce a total<br />

value. This view shows not only the individual values, but also an overview of all the values.<br />

In <strong>OpenOffice</strong>.<strong>org</strong>, various types of charts can be displayed in a stacked form. All of these charts support the<br />

com.sun.star.chart.StackableDiagram service, which in turn provides the following properties:<br />

Stacked (Boolean)<br />

activates the stacked viewing mode<br />

Percent (Boolean)<br />

rather than absolute values, displays their percentage distribution<br />

Chart Types<br />

Line Charts<br />

Line charts (com.sun.star.chart.LineDiagram) support two X-axes, two Y-axes and one Z-axis. They can be<br />

displayed as 2D or 3D graphics (com.sun.star.chart.Dim3Ddiagramservice). The lines can be stacked<br />

(com.sun.star.chart.StackableDiagram).<br />

Line charts provide the following properties:<br />

SymbolType (const)<br />

symbol for displaying the data points (constant in accordance with com.sun.star.chart.ChartSymbolType)<br />

SymbolSize (Long)<br />

size of symbol for displaying the data points in 100ths of a millimeter<br />

140 <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!