Working with Charts

From Apache OpenOffice Wiki
Jump to: navigation, search



Document Structure

The important service for charts is com.sun.star.chart.ChartDocument. The chart document contains all the top-level graphic objects, such as a legend, up to two titles called Title and Subtitle, an axis title object for each primary axis if the chart supports axis. The com.sun.star.chart.ChartArea always exists. This is the rectangular region covering the complete chart documents background. The important graphical object is the diagram that actually contains the visualized data.

Apart from the graphical objects, the chart document is linked to some data. The required service for the data component is com.sun.star.chart.ChartData. It is used for attaching a data change listener and querying general properties of the data source, such as the number to be interpreted as NaN ("not a number"), that is, a missing value. The derived class com.sun.star.chart.ChartDataArray allows access to the actual values. Every component providing the ChartData service should also support ChartDataArray.

The following diagram shows the services contained in a chart and their relationships.

ChartDocument

The name spaces in the diagram have been omitted to improve readability. The services are all in the name space com.sun.star.chart. The interfaces in this diagram are com.sun.star.chart.XChartDocument, com.sun.star.drawing.XShape, com.sun.star.lang.XComponent, and com.sun.star.beans.XPropertySet.

The chart document model passes its elements through the interface com.sun.star.chart.XChartDocument. This interface consists of the following methods:

  com::sun::star::chart::XChartData getData()
  void attachData( [in] com::sun::star::chart::XChartData xData)
  com::sun::star::drawing::XShape getTitle()
  com::sun::star::drawing::XShape getSubTitle()
  com::sun::star::drawing::XShape getLegend()
  com::sun::star::beans::XPropertySet getArea()
  com::sun::star::chart::XDiagram getDiagram()
  void setDiagram( [in] com::sun::star::chart::XDiagram xDiagram)
 
  void dispose()
  void addEventListener( [in] com::sun::star::lang::XEventListener xListener)
  void removeEventListener( [in] com::sun::star::lang::XEventListener aListener)
  boolean attachResource( [in] string aURL,
  [in] sequence <com::sun::star::beans::PropertyValue aArgs)
  string getURL()
  sequence <com::sun::star::beans::PropertyValue > getArgs()
 
  void connectController( [in] com::sun::star::frame::XController xController)
  void disconnectController( [in] com::sun::star::frame::XController xController)
  void lockControllers()
  void unlockControllers()
  boolean hasControllersLocked()
  com::sun::star::frame::XController getCurrentController()
  void setCurrentController( [in] com::sun::star::frame::XController xController)
  com::sun::star::uno::XInterface getCurrentSelection()
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages