I have a monthly graph that I use to report payroll averages and want to have a title or subtitle in the graph that is equal to my date range specified in cell b3. I haven't been able to find a way to make the contents of a cell the title of subtitle of my chart. Any ideas?
Thanks for your help.
OOo 3.2.1, Windows 8.1
[Solved] Use the contents of a cell as a chart title?
-
NLRobinson
- Posts: 2
- Joined: Tue Mar 08, 2011 8:09 pm
[Solved] Use the contents of a cell as a chart title?
Last edited by MrProgrammer on Sat Oct 31, 2020 5:52 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]
Reason: Tagged ✓ [Solved]
OpenOffice 3.3 on Windows Vista
- Charlie Young
- Volunteer
- Posts: 1559
- Joined: Fri May 14, 2010 1:07 am
Re: How do I use the contents of a cell as a chart title?
From Calc Help:
It would probably be possible to do something with a macro, but methinks it would get tricky to have something that automatically changed the titles when the cell content changes.It is not possible to link the title text to a cell. You must enter the text directly.
Apache OpenOffice 4.1.1
Windows XP
Windows XP
Re: How do I use the contents of a cell as a chart title?
Workaround: Use a cell to display the title. See attached file, where the D15 "chart title" cell uses a link to the table title in A1. With coloured background in the cells and transparency on the chart background, it doesn't look too bad. (I will not insist that you use that colour. It was chosen at random.
)
- Attachments
-
- Dynamic title.ods
- (18.64 KiB) Downloaded 1815 times
Apache OO 4.1.12 and LibreOffice 7.5, mostly on Ms Windows 10
Re: How do I use the contents of a cell as a chart title?
Nice idea! Clever workaround.
AOO4/LO5 • Linux • Fedora 23
Re: How do I use the contents of a cell as a chart title?
Bind a text box from toolbar "Form Controls" to a cell and place it in front of the chart.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: How do I use the contents of a cell as a chart title?
Here is an another idea... (user defined macro function):
You must use the primer (inner) names of Charts (OLE objects): «Object 1», etc.
(Delete any custom Chart names such «MyGraph003»)
I feel that, there is some bug about the handling of the chart names:
When you create a chart by a Macro, the programatically given name will rewrite the «inner» name of chart, and then you can get the chart by its macro defined name.
But when you create a chart manually, and you edit the NAME of chart, then you can not get the chart by a macro based on its displayed name.
If you delete the user defined name, the «name» will reset to the «inner» name, and you can get the chart by macro again by the displayed name.
(Use the Navigator to display the actual names of the Charts – or names of the OLE objects.
Code: Select all
Function SetGraphTitle(GraphName as string,TitleString as string) as string
Dim Doc As Object
Dim Charts As Object
Dim Chart as Object
Dim NumberOfCharts as integer
Dim i as integer
Doc = StarDesktop.CurrentComponent
Charts = Doc.Sheets(0).Charts
NumberOfCharts = Charts.Count
'Print NumberOfCharts
SetGraphTitle = "Chart named '" + GraphName + "' is missing"
For i = 0 to NumberOfCharts-1
Chart = Charts(i)
'Print Chart.Name
If Chart.Name = GraphName then
Chart = Charts.getByName(GraphName).embeddedObject
Chart.HasMainTitle = True
Chart.Title.String = TitleString
SetGraphTitle = "OK"
end if
Next i
end function(Delete any custom Chart names such «MyGraph003»)
I feel that, there is some bug about the handling of the chart names:
When you create a chart by a Macro, the programatically given name will rewrite the «inner» name of chart, and then you can get the chart by its macro defined name.
But when you create a chart manually, and you edit the NAME of chart, then you can not get the chart by a macro based on its displayed name.
If you delete the user defined name, the «name» will reset to the «inner» name, and you can get the chart by macro again by the displayed name.
(Use the Navigator to display the actual names of the Charts – or names of the OLE objects.
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.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: LO3.3.0-25.8.5.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.