Re: Insert column and line chart in calc

Ingrid Halama <[email protected]>
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
Hi Pivithuru,

Pivithuru Wijegunawardana wrote:
> Hi,
> 
> I used the following code segment to set the chart type to bar diagram and
> then set the "NumberOfLines" property value. But I couldn't see the lines in
> the chart. And also I tried to change some other properties also. I couldn't
> do any property changes.
> 
> In the api documentation for bar diagrams
> http://api.openoffice.org/docs/common/ref/com/sun/star/chart/BarDiagram.html ,
> it has been stated that "NumberOfLines" property value is a long value. But
> when I use long it gives an error stating that it should be an integer. But
> even after correcting that error also it was not successful.
> 
>  XDiagram aDiagram = (XDiagram) UnoRuntime.queryInterface(
>                         XDiagram.class,
> aFact.createInstance("com.sun.star.chart.BarDiagram"));
> 
>                 XPropertySet pSet = (XPropertySet)
> UnoRuntime.queryInterface(
>                         XPropertySet.class, aDiagram);
> 
>                 pSet.setPropertyValue("NumberOfLines", new Integer(1));
> 
>                 aChartDocument.setDiagram(aDiagram);
> 
> 

Please try to set the diagram to the document first and set the other 
properties later.

Hope that helps,
Ingrid
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.