von Pit66 » Do, 23.04.2020 11:51
Hallo Rik,
so richtig funzt das bei mir noch nicht...
Es bleibt in der do loop Schleife hängen, weil .LineColor nicht überschrieben wird.
Halbe Stunde später...
Hab's jetzt selbst rausgefunden .FillColor kann man beschreiben und bekommt damit den gleichen Effekt.
LO Version: 6.2.8.2 (x64)
Code: Alles auswählen
sub test
oDoc = ThisComponent
oView = oDoc.CurrentController
oSheet = oDoc.Sheets.getByName("Tabelle1")
Dim oCharts
oCharts = oSheet.Charts
Dim oChart
for i=0 to oCharts.count-1
oChart = oCharts.getByIndex(i).EmbeddedObject
oChart.lockControllers
oDiagram = oChart.Diagram
oDataSequences = oChart.UsedData.DataSequences
'msgbox (ubound (oDataSequences))
if (ubound (oDataSequences)) = 2 then 'Anzahl der Datenreihen
for k = 0 to ubound (oDataSequences)
do
oDataRowProperties = oDiagram.getDataRowProperties(k)
'oDataRowProperties.LineColor = RGB(0,255,0)
oDataRowProperties.FillColor = RGB(0,255,0)
loop while oDataRowProperties.LineColor <> RGB(0,255,0)
next k
end if
oChart.unlockControllers
next i
end sub
Hallo Rik,
so richtig funzt das bei mir noch nicht...
Es bleibt in der do loop Schleife hängen, weil .LineColor nicht überschrieben wird.
Halbe Stunde später...
Hab's jetzt selbst rausgefunden .FillColor kann man beschreiben und bekommt damit den gleichen Effekt.
LO Version: 6.2.8.2 (x64)
[code]sub test
oDoc = ThisComponent
oView = oDoc.CurrentController
oSheet = oDoc.Sheets.getByName("Tabelle1")
Dim oCharts
oCharts = oSheet.Charts
Dim oChart
for i=0 to oCharts.count-1
oChart = oCharts.getByIndex(i).EmbeddedObject
oChart.lockControllers
oDiagram = oChart.Diagram
oDataSequences = oChart.UsedData.DataSequences
'msgbox (ubound (oDataSequences))
if (ubound (oDataSequences)) = 2 then 'Anzahl der Datenreihen
for k = 0 to ubound (oDataSequences)
do
oDataRowProperties = oDiagram.getDataRowProperties(k)
'oDataRowProperties.LineColor = RGB(0,255,0)
oDataRowProperties.FillColor = RGB(0,255,0)
loop while oDataRowProperties.LineColor <> RGB(0,255,0)
next k
end if
oChart.unlockControllers
next i
end sub[/code]