Hi othman,
othman wrote:
Sorry, i hope you bare with me & be patient answering my questions about the
chart2 API.
i wrote a java code to change the type of my chart from default LineType to
candlestick type.
However this code doesn't work with chart2 .but if i change to standar
com.sun.star.chart and use type "com.sun.star.StockDiagram" it does work
perfectly.
what is wrong with the chart2 code (or how to change my chart2 type to
candlestick )?
Instances of chart2 chart types (e.g.
com.sun.star.chart2.CandleStickChartType) do support service
com::sun::star::chart2::ChartType. Look at the corresponding idl file.
They do not support the interface com::sun::star::chart2::XDiagram, but
instead they support interface com::sun::star::chart2::XChartType. They
need to be added to the com::sun::star::chart2::XChartTypeContainer as
shown in my mail from August 18th.
In general both APIs do not have the same structure. The only touch
point is the chart document itself which does support both interfaces
com::sun::star::chart2::XChartDocument and
com::sun::star::chart::XChartDocument. Starting from there both APIs
from different object trees.
Kind regards,
Ingrid
thanks.
code :
XEmbeddedObjectSupplier xEmbeddedObjSupplier = (XEmbeddedObjectSupplier)
UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class,
xtablechart);
XInterface xInterface = xEmbeddedObjSupplier.getEmbeddedObject();
com.sun.star.chart2.XChartDocument xChartDoc =
(com.sun.star.chart2.XChartDocument)UnoRuntime.queryInterface(
com.sun.star.chart2.XChartDocument.class, xInterface);
com.sun.star.chart2.XDiagram xDiagram =
(com.sun.star.chart2.XDiagram) xChartDoc.getFirstDiagram();
XMultiServiceFactory xMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface( XMultiServiceFactory.class, xChartDoc
);
Object object = xMSF.createInstance(
"com.sun.star.chart2.CandleStickChartType" );
xDiagram = (com.sun.star.chart2.XDiagram)
UnoRuntime.queryInterface(com.sun.star.chart2.XDiagram.class, object);
XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(
XPropertySet.class, xDiagram );
xChartDoc.setFirstDiagram(xDiagram);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]