LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
JbL JbL is offline
external usenet poster
 
Posts: 17
Default Setting Chart MajorUnit for Clean lookng Chart

Hi,

I'm hoping a chart guru can help me solve this pesky problem. I have load
of charts that are dynamic (mostly single series) and I'm trying to finish my
code that will adjust the Y-axis and major unit so that the data will
maximize the chart area as best as possible and have clean gridlines of
approx. 5 per chart (including the zero line if both + & - values)

I have been able to read/write the chart's max/min values as well as set the
scaling, but my problem lies in the fact that I can't seem to adjust these
values and then set a MajorUnit so that the gridlines all appear nice and
neat , especially at the Max Scale and around 0 (if both pos and neg).

For example, my code will round Max/Min values up by the nearest 5,10,20 etc
depending on the max level in the chart, so in my example a series with a max
value of 29.1, the max scale is set at 40 (nearest 10, plus 10). THe series
min value is -42.3 and the Min scale gets set to -50.

In order to have around 5 gridlines the majorunit was set at 20. My current
non-working method has been to take the following:

MajUnit = (Abs(Newmax) + Abs(Newmin)) / 5

which I have tried to round to a more suitable number. However, the chart
in this example shows major units at -50, -30, -10, 10, 30 and then there is
space above the y-axis above the last gridline. A more suitable scaling
would really be min = -50, max = 50 and major unit = 25. Not totally maxing
out the space, but close enough.

There are so many charts that fine tuning this by hand is a nightmare. I
just can't get the code to set a max/min scale that will have the clean grids
I'm looking for.

I know this is too long, but if anyone out there has any guidance I would
greatly appreciate it.

Regards,
jbl
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart setting scale Ker Charts and Charting in Excel 3 March 11th 09 03:28 PM
Setting a Goal in a Chart Larry Charts and Charting in Excel 2 December 12th 06 03:26 PM
setting the radius of a pie chart anson Charts and Charting in Excel 1 February 23rd 05 02:08 PM
Setting the range in a chart using VB Torben Laursen Excel Programming 1 March 3rd 04 02:16 PM
vc++ automation: opening chart as chart window and setting scale Mike Biolsi Excel Programming 0 February 7th 04 08:13 AM


All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"