Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index



I'm having trouble writing a simple Basic macro to extend a chart's X-axis. The 
bottom of the chart starts off looking like this:

|           |
|-----------|
1   2   3   4

My macro is:

Sub Main
Dim Doc As Object 
Dim Charts As Object 
Dim Chart as Object 
Doc = ThisComponent
Charts = Doc.Sheets(0).Charts 
Chart = Charts.getByIndex(0).EmbeddedObject
Chart.Diagram.XAxis.Max = Chart.Diagram.XAxis.Max + 4
End Sub

and in the end, I want the bottom of the chart to be:

|             |
|-------------|
1 2 3 4 5 6 7 8

Instead, I get

|           |
|-----------|
1234

I'm sure the problem has something to do with the fact that the Format > Data 
Ranges... menu item's content remains unchanged, i.e., stays

$Sheet1.$A$1:$A$5

instead of changing to

$Sheet1.$A$1:$A$9

which gives the chart the appearance I want. Any ideas re modules, services, 
methods to get/set the chart's data range? TIA,

Jonathan




 

-- 
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


 

 

 

 

-----Original Message-----
From: Jonathan Levi <drjlevi6@aol.com>
To: users <users@global.libreoffice.org>
Sent: Sun, Nov 11, 2012 12:55 pm
Subject: [libreoffice-users] Macro Problem: Extending a Chart's X-axis






I don't know if this is the right list to query, but I'm having trouble writing 



a simple Basic macro to extend a chart's X-axis. The bottom of the chart starts 



off looking like this:







|           |



|-----------|



1   2   3   4







My macro is:







Sub Main



Dim Doc As Object 



Dim Charts As Object 



Dim Chart as Object 



Doc = ThisComponent



Charts = Doc.Sheets(0).Charts 



Chart = Charts.getByIndex(0).EmbeddedObject



Chart.Diagram.XAxis.Max = Chart.Diagram.XAxis.Max + 4



End Sub







and in the end, I want the bottom of the chart to be:







|             |



|-------------|



1 2 3 4 5 6 7 8







Instead, I get







|           |



|-----------|



1234







I'm sure the problem has something to do with the fact that the Format > Data 



Ranges... menu item's content remains unchanged, i.e., stays







$Sheet1.$A$1:$A$5







instead of changing to







$Sheet1.$A$1:$A$9







which gives the chart the appearance I want. Any ideas re modules, services, 



methods to get/set the chart's data range? TIA,







Jonathan



















 







-- 



For unsubscribe instructions e-mail to: users+help@global.libreoffice.org



Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/



Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette



List archive: http://listarchives.libreoffice.org/global/users/



All messages sent to this list will be publicly archived and cannot be deleted








 
 

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.