how do i set colors of datarows in a linechart by macro?

i can set axis colors like this:
Chart.Diagram.XMainGrid.LineColor = RGB(192, 192, 192)
(where Chart is ThisComponent.Sheets(0).Charts(0).EmbeddedObject)
but how do i set the colors of the datalines ?

i’ve found “interface XColorScheme” with “getColorByIndex” in the docs but calling it like “Chart.Diagram.getColorByIndex(1)” gives me an error, not sure if “scheme” is the right thing to use in this case either.

You can set line colors with:

    'Get first chart on specified sheet'
	oChart = thisComponent.Sheets.getByName("YOUR_SHEET").getCharts().getByIndex(0)
	oEmbeddedObject = oChart.getEmbeddedObject()
	oFirstDiagram = oEmbeddedObject.getFirstDiagram()
	oCoordinateSystems = oFirstDiagram.getCoordinateSystems()
	oXCoordinateSystem = oCoordinateSystems(0)
	oChartTypes = oXCoordinateSystem.getChartTypes()
	oXChartType = oChartTypes(0)
	oDataSeries = oXChartType.getDataSeries()
'Index indicates which line you are working with'
	oXDataSeries = oDataSeries(0)
'Line color to be used'
	oXDataSeries.Color = RGB(192, 192, 192)

@Ratslinger: well done!!
deep insight of the “API-Hell

@karolus Much appreciated.