My script makes only points with line. Instead of this standard line I want to have points with regression line.
`
ChartNo = 1
sName = "test_" + str(ChartNo)
sDataRng = "A10:B20"
SheetForRectangle = ThisComponent.Sheets.getByName("Rectangle")
ChartsForTest = SheetForRectangle.getCharts()
AddressForCells = SheetForRectangle.getCellRangeByName( sDataRng ).getRangeAddress()
If ChartsForTest.hasByName(sName) Then
ChartsForTest.removeByName(sName)
End If
If NOT ChartsForTest.hasByName(sName) Then
RectForTest = createObject("com.sun.star.awt.Rectangle")
RectForTest.X = 10000
RectForTest.Y = 10000
RectForTest.width = 20000
RectForTest.Height= 10000
ChartsForTest.addNewByName(sName, RectForTest, Array(AddressForCells), False, True)
End If
ChartForTest = ChartsForTest.getByName( sName )
ChartForTest.setRanges(Array(AddressForCells))
oChartDoc = ChartForTest.getEmbeddedObject()
oTitle = oChartDoc.getTitle()
oTitle.String = "Some title"
oChartDoc.HasLegend = 1
LegendForTest = oChartDoc.Legend
oChartDoc.Legend.Alignment = com.sun.star.chart.ChartLegendPosition.RIGHT
oChartDoc.Legend.FillStyle = com.sun.star.drawing.FillStyle.SOLID
oChartDoc.Legend.FillColor = RGB(210, 210, 210)
oChartDoc.Legend.LineColor = RGB(50, 0, 0)
oChartDoc.Legend.CharHeight = 7
oDiagram = oChartDoc.createInstance( "com.sun.star.chart.XYDiagram" )
oChartDoc.setDiagram(oDiagram)
oDiagram = oChartDoc.getDiagram()
oDiagram.Lines = True
oDiagram.SymbolType = -10
oDiagram.HasXAxisTitle = True
oDiagram.XAxisTitle.String ="Some X-Axis"
oDiagram.HasYAxisTitle = True
oDiagram.YAxisTitle.String ="Some Y-Axis"
oDiagram.RegressionCurves = com.sun.star.chart.ChartRegressionCurveType.LINEAR
oDiagram.DataRowSource = com.sun.star.chart.ChartDataRowSource.COLUMNS
`
What I do wrong? Why it is going without regression line?