In the LibreOffice Calc book, a sheet with a data table in the range A1:U39 is created and a 3D pie chart is created in it at position V1 with the data range: H3:R3;H35:R35.
In the pie chart, I need to change the properties:
- Chart subtitle set font to italic
- Data series in rows - (true)
- Data series in columns - (false)
- Add data labels for all data series and in ‘Text Attributes’ set:
‘Values as number’ - (false)
‘Values as percentages’ - (true)
‘Category - (true)’, - In ‘Attribute Options’ set:
Placement - (empty) - On tab ‘Font Effects’ in 'Text Decoration’set:
Underlining -(Single)
Code snippet:
chart_name = “2023_03Pie”
range1 = oSheet.getCellRangeByName(“H3:R3”)
range2 = oSheet.getCellRangeByName(“H35:R35”)
RANGES = Array(range1.RangeAddress, range2.RangeAddress)
with rec
.X = 47410
.Y = 0
.Width = 29270
.Height = 16430
end with
Charts.addNewByName(chart_name, rec, RANGES, True, True)
oChart = charts.getByName(chart_name).EmbeddedObject
oChart.Diagram = oChart.createInstance("com.sun.star.chart.PieDiagram")
oChart.Title.String = "Discord articles"
oChart.Title.CharHeight = 20
oChart.SubTitle.String = "(in percentages)"
oChart.SubTitle.CharHeight =14
oChart.Diagram.Dim3D = True
oChart.DataSourceLabelsInFirstColumn = False
oChart.HasLegend = True
==