Hi everyone! I am writing a script in Python to create a scatter plot in Calc. For now I can plot the points from the data looking like this:
Is it possible to add point labelling on the chart? I tried to add a column with labels, but that creates a second set of points. My code looks like this for now:
charts = sheet.getCharts()
rect = Rectangle()
rect.Width, rect.Height, rect.X, rect.Y = 22000, 12000, 1000, 9200
range_address = []
range_address.append(CellRangeAddress())
range_address[0].Sheet = sheet.RangeAddress.Sheet
range_address[0].StartColumn = 1
range_address[0].EndColumn = 3
range_address[0].StartRow = 0
range_address[0].EndRow = 4
charts.addNewByName("SimilarityMap", rect, tuple(range_address), False, False)
chart = charts.getByName("SimilarityMap").getEmbeddedObject()
chart.createInstance("com.sun.star.chart.XYDiagram")
chart.HasMainTitle = True
chart.HasLegend = True
chart.Title.String = "Similarity Map"
chart.Title.CharHeight = 24
chart.HasSubTitle = False
diagram = chart.getDiagram()
diagram.Lines = False