我想更改由制作 XYDiagram 产生的数据点的大小,如下所示。
Dim Rect As New com.sun.star.awt.Rectangle
Dim RangeAddress(0) As New com.sun.star.table.CellRangeAddress
Rect.X = 0
Rect.Y = 6666 * (x/3)
Rect.Width = 16500
Rect.Height = 6666
RangeAddress(0).Sheet = 0
RangeAddress(0).StartColumn = x+1
RangeAddress(0).StartRow = 1
RangeAddress(0).EndColumn = x+2
RangeAddress(0).EndRow = y-1
ThisComponent.Sheets(0).Charts.addNewByName(mode, Rect, RangeAddress(), False, False)
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.Diagram _ = ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.createInstance("com.sun.star.chart.XYDiagram")
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.Diagram.HasXAxisTitle = True
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.Diagram.XAxisTitle.String ="Ratio"
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.Diagram.HasYAxisTitle = True
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.Diagram.YAxisTitle.String ="Cost"
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.Diagram.getDataRowProperties(1).lines = false
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.HasLegend = False
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.HasMainTitle = True
ThisComponent.Sheets(0).Charts.getByName(mode).embeddedObject.Title.String = mode
此代码将正确生成 XY 散点图,但点太大。鉴于我正在绘制的数据的性质,我希望代码自动使点变小,而不是我为每个生成的图形更改大小。有谁知道如何编辑数据点大小?我搜索了几天如何做到这一点,但我找不到它,似乎没有多少人在使用 libreoffice calc basic。