xDesktop = UNO.createDesktop() xComponentLoader = xDesktop~XComponentLoader url = "private:factory/scalc" calcComponent = xComponentLoader~loadComponentFromURL(url, "_blank", 0, .UNO~noProps) xSheet = calcComponent~XSpreadSheetDocument~getSheets~XIndexAccess~getByIndex(0) ~XSpreadSheet call uno.setCell xSheet, 0, 0, "Hello World, here is a random plot from Group 8" xSheet~getCellByPosition(0,2)~setFormula("Here are some random coordinates") xSheet~getCellByPosition(1,3)~setFormula("x") xSheet~getCellByPosition(2,3)~setFormula("y") do i=4 to 6 call uno.setCell xSheet, 0, i, "Coordinates"i-3 call uno.setCell xSheet, 1, i, random(10,40) call uno.setCell xSheet, 2, i, random(10,50) end x=xSheet~XCellRange~getCellRangeByName("B5:B7")~XPropertySet y=xSheet~XCellRange~getCellRangeByName("C5:C7")~XPropertySet cc_x=box("int", "c5 00 0b"x ~c2d) cc_y=box("int", "c0 00 b5"x ~c2d) x~setPropertyValue("CharColor", cc_x) y~setPropertyValue("CharColor", cc_y) x~setPropertyValue("NumberFormat", 4) y~setPropertyValue("NumberFormat", 4) call uno.setCell xSheet, 0, 8, "And here is a beautiful plot of the Coordinates <3" oRect = .bsf~new("com.sun.star.awt.Rectangle") oRect~X = 0 oRect~Y = 5400 oRect~Width = 18000 oRect~Height = 8000 xRange=xSheet~XCellRange ~getCellRangeByName("A4:C7") rangeAddr = xRange~XCellRangeAddressable~getRangeAddress call UNO.loadClass "com.sun.star.table.CellRangeAddress" arrAddr = bsf.createArray(.UNO~CellRangeAddress, 1) arrAddr[1] = rangeAddr xTableCharts = xSheet~XTableChartsSupplier~getCharts xTableCharts~addNewByName("Chart", oRect, arrAddr, .true, .true) calcComponent~XModifiable~setModified(.false) ::requires UNO.CLS