Edit: Changed subject, was Doing graphs: x and y axes question Make your post understandable by others -- MrProgrammer, forum moderator |
[Solved] Use cell reference for chart's scale maximum
[Solved] Use cell reference for chart's scale maximum
Can I replace the max values of the scales for x or y axes to a reference to a cell, something like INDIRECT("N3") or anything similar to that? Thanks! png file.
- Attachments
-
- snap1.png (23.91 KiB) Viewed 1222 times
Last edited by MrProgrammer on Wed Mar 27, 2024 12:30 am, edited 2 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 4 on SuSE opensuse-lean 15.0
Re: Doing graphs: x and y axes question
Not an answer to your question, but your signature shows OpenOffice 3.2 on SuSE 10.0 If you have upgraded from those elderly packages, perhaps you might update your signature to reflect the software and operating system you currently use.
From a quick test, it seems the answer to your question may be No.
From a quick test, it seems the answer to your question may be No.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.3.2; SlackBuild for 24.2.3 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.3.2; SlackBuild for 24.2.3 by Eric Hameleers
Re: Doing graphs: x and y axes questionT
Thanks! I updated my signature.
OpenOffice 4 on SuSE opensuse-lean 15.0
- Hagar Delest
- Moderator
- Posts: 32692
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: Use cell reference for chart's scale maximum
I don't think you can directly with a link to a cell.
But maybe a macro could do that.
You can ask for it, I think it would be a nice feature: [Tutorial] Reporting bugs or suggestions.
But maybe a macro could do that.
You can ask for it, I think it would be a nice feature: [Tutorial] Reporting bugs or suggestions.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
Re: Use cell reference for chart's scale maximum
A macro can do it, but it must be written and called.
Charts have complicated models, and I'm not sure for which types the proposed (roughly sketched) solution will work. (Tested with AOO V 4.1.7.)
Charts have complicated models, and I'm not sure for which types the proposed (roughly sketched) solution will work. (Tested with AOO V 4.1.7.)
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Use cell reference for chart's scale maximum
Here is a "solution" with macro cell function. It for the Ymin value only, but you can modify the macro code. It will refresh automatically, when the passed parameters are changed.(Tested in the LibreOffice 7.5.8):
The macro code:
Code: Select all
REM ***** BASIC *****
Option explicit
function RescaleYmin(ShNr as integer, ChartName as string, Ymin as double) as string
dim oDoc as object
dim oSheets, oSheet as object
dim oGrObjects, oGrObject as object
dim oCharts, oChart as object
dim oChartModel as object
dim oYAxisProp as object
dim iNumOfGrObjects, iNumOfCharts, i as integer
dim sResult as string
sResult = "Error"
oDoc = Thiscomponent
oSheets = oDoc.Sheets
oSheet = oSheets.getByIndex(ShNr-1)
oGrObjects = oSheet.DrawPage
iNumOfGrObjects = oGrObjects.Count
For i = 0 to iNumOfGrObjects-1
oGrObject = oGrObjects.getByIndex(i)
If oGrObject.Name = ChartName then
oYAxisProp = oGrObject.Model.Diagram.YAxis
oYAxisProp.AutoMin = false
oYAxisProp.Min = Ymin
sResult = "Done"
end if
next i
RescaleYmin = sResult
End function
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Use cell reference for chart's scale maximum
Thank you all for your replies! They were helpfull and answerd my question!
OpenOffice 4 on SuSE opensuse-lean 15.0