Chart Functionality: use cells for chart options & titles

Discuss the spreadsheet application
Post Reply
Myndex
Posts: 19
Joined: Fri May 17, 2019 8:34 am

Chart Functionality: use cells for chart options & titles

Post by Myndex »

There are a few aspects of CHARTS that would be very useful to be able to reference the data in a cell:

Titles - Titles based on a cell's contents. I am aware of the various workarounds, none of which allow the use of "save as image."

Axis Minimum, Maximum, Divisions, etc. - the "automatic" versions are less than desirable with poorly defined defaults (mainly leaving far too much empty space)

Data Range - If you have a set of data that changes in quantity, it would be very useful to have the range auto adjust as it "range adjusts to exclude end of range at 0". If the total data range was defined in a cell, it would be trivial to fix this.


thank you

A
MacOS 10.6.8 thru 10.13.6 depending on which machine. OpenOffice 4.1.7 and Libre Office 6.3.2.2 on my MacBook.
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: Chart Functionality: use cells for chart options & title

Post by jrkrideau »

I think you would need to put in requests to the developers. This forum simply users helping users.

Alternatively, you may need to move to a more sophisticated graphing package. A fairly simple-to-use but sophisticated graphing package is Gnuplot.
LibreOffice 7.3.7. 2; Ubuntu 22.04
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Chart Functionality: use cells for chart options & title

Post by Zizi64 »

You can to realize these tasks by your own macro functions or subroutines.
You need write your macros (instead of recording them), because the macro recorder has a very limited capability.
You need create the macro based on the API functions and procedures of the AOO/LO. API: Application Programming interface.
These macro will control the charts referenced by their names.
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.
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Chart Functionality: use cells for chart options & title

Post by Zizi64 »

Here is a sample file with some embedded macro for modify some Chart properties.
Tha macro will get the Chart objects as Shapes, then check the type of the shape, and then modify the properties the properties of the OLE type Shapes based on the contents od some Named cells.


Note: The graphical objects have more than one names. One for the Shape, and an other for the embedded object in the Shape
The chart shape have Name and PersistName properties.

The sample file was created in the LibreOffice 6.2.8
Chart properties.ods
(25.07 KiB) Downloaded 86 times
ChartPropertiesMacro.png
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.
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Chart Functionality: use cells for chart options & title

Post by Zizi64 »

Here is a new version of my sample file with more chart properties.

Install and use one of the existing object ispection tools like the XrayTool or MRI. I am using the XrayTool.
Chart properties.ods
(24.21 KiB) Downloaded 74 times
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.
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Chart Functionality: use cells for chart options & title

Post by Zizi64 »

Refresh data ranges (by modifying the StartRow and EndRow parameter)
Chart properties3.ods
(28.82 KiB) Downloaded 73 times
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.
Myndex
Posts: 19
Joined: Fri May 17, 2019 8:34 am

Re: Chart Functionality: use cells for chart options & title

Post by Myndex »

Zizi64 wrote:Refresh data ranges (by modifying the StartRow and EndRow parameter)
Chart properties3.ods

I love this! thank you this is very very helpful!
MacOS 10.6.8 thru 10.13.6 depending on which machine. OpenOffice 4.1.7 and Libre Office 6.3.2.2 on my MacBook.
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Chart Functionality: use cells for chart options & title

Post by Zizi64 »

I never know about some properties and/or I never know the location of some properties of the charts located in the sample file.

But the XrayTool can list them. As you can see it in the grayed lines of the macro code beginning the 'xray word
Use an object inspection tool, if you want to work efficiently with the macros.
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.
Post Reply