Thank you for help!
It was a tough journey, but I've reached my finall destination! Off Topic but, I discovered a strange thing: first you hate that OpenOffice doesn't utilize MS VBA, and after a few days with your head deep in StarBasic, you begin to love it even more than VBA (^-^). In my project I have a XYDiagram chart embeeded in the sheet. Here's the code.
Adding Trenlines:
Code: Select all
oSheet = ThisComponent.CurrentController.ActiveSheet
oDiagram = oSheet.Charts(0).EmbeddedObject.getDiagram()
oDataRowProperties = oDiagram.getDataRowProperties(1)
oDataRowProperties.RegressionCurves = com.sun.star.chart.ChartRegressionCurveType.LINEAR
oDataRowProperties.DataRegressionProperties.LineColor = RGB(0,0,0)
oDataRowProperties.DataRegressionProperties.LineWidth = 100
To delete a line:
Code: Select all
oDataRowProperties.RegressionCurves = com.sun.star.chart.ChartRegressionCurveType.NONE
Adding markers:
Code: Select all
oSheet = ThisComponent.CurrentController.ActiveSheet
oDiagram = oSheet.Charts(0).EmbeddedObject.getDiagram()
oForm = oSheet.DrawPage.Forms.GetByIndex(0)
oDataRowProperties = oDiagram.getDataRowProperties(1)
oDataRowProperties.SymbolType = 1
oDataRowProperties.LineColor = RGB(0, 255, 255)
Size = oDataRowProperties.SymbolSize
Size.Height = 250
Size.Width = 250
oDataRowProperties.SymbolSize = Size
VERY IMPORTANT NOTE: In XYDiagrams, the first series has an index 1, because the first array of values contains the x-values of the diagram that is not visualized. This behavior exists for historical reasons.
To delete markers (or beter say, hide them):
Code: Select all
oDataRowProperties.SymbolType = -3