Like the title says I'm having problem with modifying the data range of an existing chart. Most documentation I can find only touches upon how to create charts not modify them.
What I'm trying to do is tell an existing chart that its data range should be current + one row. Where a new row represent a new entry.
I found this site: http://computing.ingreatway.com/2013/11 ... geaddress/ that contained an example on how to do it but couldn't get it to work.
[Solved] [Calc] Modifing Chart Data Range
[Solved] [Calc] Modifing Chart Data Range
Last edited by kebab4you on Thu Jul 09, 2015 5:43 pm, edited 1 time in total.
OpenOffice 4.1.1
Windows 7
Windows 7
Re: [Calc] Modifing Chart Data Range
Does this help?
viewtopic.php?f=20&t=58949&hilit=chart#p260525
viewtopic.php?f=20&t=58949&hilit=chart#p260525
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: [Calc] Modifing Chart Data Range
Seems to be what I'm looking for. Will give it a try.FJCC wrote:Does this help?
viewtopic.php?f=20&t=58949&hilit=chart#p260525
Edit: It worked perfectly! I got an extra question though. I can never seem to find my charts by using the findByName function. These are chart that I did not create programmatically so how do I give them a name?
OpenOffice 4.1.1
Windows 7
Windows 7
Re: [Solved][Calc] Modifing Chart Data Range
I don't see a way to assign a name to a chart with the user interface. The name seems to get assigned automatically with no chance to modify it. If you right click on the chart and select Name you can assign a value to the DisplayName property that a macro can access like this
You could iterate through the charts using getByIndex() and check the DisplayName to find out which chart you have.
Code: Select all
oSheets = ThisComponent.getSheets()
oObj1 = oSheets.getByName("Hoja1")
oCharts = oObj1.getCharts()
oObj2 = oCharts.getByName("Object 1")
print oObj2.DisplayNameOpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.