calc: how can I (via macro) create and format a 2ndary Y axis in a chart ?

Hello,
I have data from a database imported to LibreOffice via JDBC - several 100 up to some 1000 rows and > 400 columns. I would like to create a chart to display data from selected columns. That so far works for me.

However, I frequently need more than one Y axis. Unfortunately, the macro recorder does not step down into chart modifications so I cannot track required calls.

Using a macro, how can I create a 2nd (3rd …) Y axis, and assign a data series to it ?

Thank you
Malte

Hello,

ok - to display a 2ndary Y axis, I now found what to do.

  oDiagram = oChartDoc.createInstance("com.sun.star.chart.LineDiagram")
  oChartDoc.setDiagram(oDiagram)
  oDiagram = oChartDoc.getDiagram()
  oDiagram.DataRowSource = com.sun.star.chart.ChartDataRowSource.COLUMNS
  oDiagram.HasSecondaryYAxis = True

But how to assign a data series to the 2ndary Y axis ? In the documentation I found ChartAxisAssign with PRIMARY_Y and SECONDARY_Y - but no idea how to set them for a single data series …

Finally, I found another entry that told me how to access a data series. So I added the following.

   v0 = oChartDoc.FirstDiagram.CoordinateSystems(0).ChartTypes(0).DataSeries(1)
   v0.AttachedAxisIndex = 1

In my first tests, this did the job - so I will work on integrating this approach into my macro.

Thanks

Malte