Hi othman,
Again a warning about using ::com::sun::star::chart2 API: It is not
provided for external usage yet. It is an internal API that will change
further. When the API evolves your code will not work with future
versions. If you nevertheless want to use the chart2 API on your own
risk do the following:
Query your chart document for interface
com::sun::star::chart2::XChartDocument. Use method getFirstDiagram() and
getDataProvider(). Query the received diagram for
com::sun::star::chart2::XCoordinateSystemContainer. Receive the first
and only coordinate system from the container. Query the coordinate
system for interface com::sun::star::chart2::XChartTypeContainer.
There is the candlestick chart type already in. You need to add the
additional chart type 'Line' here. Create an instance of service
"com.sun.star.chart2.LineChartType" with the global service manager and
add it to the chart type container. Query the new chart type for
interface com::sun::star::chart2::XDataSeriesContainer. Create a new
data series ( create an instance of service
"com.sun.star.chart2.DataSeries") and add it to the container.
To connect data to the data series do the following. Query the series
for interface com::sun::star::chart2::data::XDataSink. Use method
createDataSequenceByRangeRepresentation() at the formerly received data
provider to create a data sequences from the cell ranges of your choice.
Set the property 'Role' at the data sequence to 'values-y'. Create an
instance of UNO service 'com.sun.star.chart2.LabeledDataSequence' and
use method setValues() to attach the formerly created sequence. Use
method 'setData()' at the formerly received interface XDataSink to
attach the labeled data sequences to the series.
Ingrid
othman wrote:
Hi,
i have a standard OHLC (candlestick) chart which could be drawn on OO
perfectly. OO could draw the OHLC chart but could not combine it with other
line charts in the same graph .
What i needed is a way to modify the OO code so that it could superimpose
charts with same coordinate system to appear on the same graph.(candlestick
chart + line charts)
The com:sun:star:chart API is very rigid on the chart type so you need to
develop new chart type to take care of our needs and it is not flexible to
use this approach.
The com:sum:star:chart2 API appears to be the answer as it has the
infrastructure in place to allow you to draw more than one charttype on the
same graph under the same coordinate system. However, I have never tried
this feature out.
does anyone know how to combine two chart types (candlestick and line chart)
in same coordinate system ? i need to do this programaticaly using java
com:sun:star:chart2 module. (as i said i have little knowledge how to use
the chart2 module)
i would appreciate any small snippet code showing how to achieve this
charttype combination. (java or even visual basic code)
thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]